How do I create a color combo box in which I can load colors at runtime and from which the user can select one.
Printable View
How do I create a color combo box in which I can load colors at runtime and from which the user can select one.
Sounds to me like you need to use the ImageComboBox control. I have a sample, but its too complex to post here. Send me your EMail address in a private memo and I will send you a .ZIP file or try using the CommonDialog .ShowColor method
John G
I have to make the user choose from three or four colors, so the Commondialog option is not feasible. I tried using the ImageCombo but it allows its contents to be derived from an imagelist. I know the three or four colors only during run time.
You should be able to load the ImageComboBox at run time with only the colors you want with no problem, but I might suggest using Pictureboxes inside a Frame. Merely set the BackColor of the PictureBox to the color of your choosing and allow the user to click the one they want. That essentially is what the CommonDialog.ShowColor does.
John G