473,386 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Put all colors in a ComboBox

I am building an application and would like to give the user the chance to
configure the look of the user interface.

I am adding a ComboBox to a DialogBox and want to populate it with the
available System background colors. The user can then set the background
color for the application. I will be doing the same with fonts, button
FlatStyles, etc.

I have tried a for each loop, but can't seem to get the syntax right.

Any help on any of these would be appreciated.
Nov 21 '05 #1
2 1039
"cashdeskmac" <ca*********@discussions.microsoft.com> schrieb:
I am adding a ComboBox to a DialogBox and want to populate it with the
available System background colors. The user can then set the background
color for the application. I will be doing the same with fonts, button
FlatStyles, etc.


\\\
Private Sub Form1_Load( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles MyBase.Load
Me.ListBox1.DataSource = _
[Enum].GetNames(GetType(KnownColor))
End Sub

Private Sub ListBox1_SelectedIndexChanged( _
ByVal sender As Object, _
ByVal e As EventArgs _
) Handles ListBox1.SelectedIndexChanged
Me.ListBox1.BackColor = _
Color.FromKnownColor( _
DirectCast( _
[Enum].Parse( _
GetType(KnownColor), _
DirectCast(ListBox1.SelectedItem, String) _
), _
KnownColor _
) _
)
End Sub
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Nov 21 '05 #2
Hi,

Here is an example that draw a sample of the color
http://www.windowsformsdatagridhelp....f-a3b7d69442c5

Ken
-------------------------
"cashdeskmac" <ca*********@discussions.microsoft.com> wrote in message
news:A8**********************************@microsof t.com...
I am building an application and would like to give the user the chance to
configure the look of the user interface.

I am adding a ComboBox to a DialogBox and want to populate it with the
available System background colors. The user can then set the background
color for the application. I will be doing the same with fonts, button
FlatStyles, etc.

I have tried a for each loop, but can't seem to get the syntax right.

Any help on any of these would be appreciated.

Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Richard | last post by:
All, In my Windows based .NET C# application I tried to change a form's background color to non-gray. The form backround color change had the desired ripple effect for most controls on the...
2
by: Mike | last post by:
Hi, I need to disable comboboxes for users with view only permissions. However, that gray background just doesn't do it for me. Is there a way to change the background / text colors when...
1
by: jesuran | last post by:
Hi, I have got a combobox which retrieves its data from a dataset: Code: Private dvsItem As DataView dvsItem = New DataView(MainForm.TempPrice.TempPriceBook.Copy) dvsItem.Sort = "ItemCode"...
3
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, In my form, I want to have a comboBox fo colors. on each color i want to add my remark (like in outlook calendar), how can i do it? Thanks, Gidi.
12
by: Derek Hart | last post by:
How would I list colors at runtime for System.Drawing.Color - I want to give the user a list of choices at runtime, such as System.Drawing.Color.AliceBlue (as an example of one color). I could...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.