Visual Basic .NET Forums  
Click here to advertise with us

Go Back   Visual Basic .NET Forums > VB.NET > Graphics/GDI+

Graphics/GDI+ Graphics discussion for VB.NET applications, Winforms, Web, Compact Framework, etc.

VB.NET Forums Newsletter Signup:
Email address:


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-28-2009, 1:53 PM
VB.NET Forum Enthusiast
.NET Framework: .NET 3.0 (VS 2005/2008)
 
Join Date: May 2008
Location: Spain
Posts: 82
Reputation: 25
J Trahair is on a distinguished programming path ahead
Default How to load a combobox with web colours

I want to load a combobox with the web colours - eg. WhiteSmoke, Gainsboro, NavajoWhite.

I know there is a ColorDialog, which has a smaller range of brighter colours. Don't want that. I also know how to fill a combobox with something.

How can I get a list of these colours?

Thanks in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-28-2009, 4:45 PM
VB.NET Forum Miyagee
.NET Framework: .NET 2.0
 
Join Date: Nov 2007
Location: Kent, UK
Age: 39
Posts: 497
Reputation: 166
InertiaM I'm the one to askInertiaM I'm the one to askInertiaM I'm the one to askInertiaM I'm the one to askInertiaM I'm the one to askInertiaM I'm the one to ask
Default

Code:
        Dim colorNames As String() = [Enum].GetNames(GetType(KnownColor))
        For Each colorName As String In colorNames
            Dim _knownColor As KnownColor = DirectCast([Enum].Parse(GetType(KnownColor), colorName), KnownColor)
            If _knownColor > KnownColor.Transparent AndAlso _knownColor < KnownColor.ButtonFace Then
                ComboBox1.Items.Add(colorName)
            End If
        Next
__________________
Always parameterize your queries - read more here
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-29-2009, 4:15 AM
VB.NET Forum Enthusiast
.NET Framework: .NET 3.0 (VS 2005/2008)
 
Join Date: May 2008
Location: Spain
Posts: 82
Reputation: 25
J Trahair is on a distinguished programming path ahead
Default

Thank you - just what I needed.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





All times are GMT -4. The time now is 11:27 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2


For advertising opportunities click here.