Solved

Color Selection Combo Box

Posted on 2002-07-30
5
301 Views
Last Modified: 2010-05-01
I have noticed that in several places in windows and in visual basic when you want to select a color there is a combo box which lists the names of the colors and a sample of each color.  I want to recreate this combo in one of my applications.  Im guessing i need to use the Imaegcombo control, but i cant find any way to insert images into that control without physicly creating an image (on the hard drive) for each color.  Is there any way to create the images dynamiclly or is that color selection box built in somewhere else?
0
Comment
Question by:spardog
5 Comments
 
LVL 39

Accepted Solution

by:
appari earned 100 total points
ID: 7189375
use windows common dialog control and use ShowColor method to show color dialog box.


Private Sub Command1_Click ()
   ' Set Cancel to True.
   CommonDialog1.CancelError = True
   On Error GoTo ErrHandler
   ' Set the Flags property.
   CommonDialog1.Flags = cdlCCRGBInit
   ' Display the Color dialog box.
   CommonDialog1.ShowColor
   ' Set the form's background color to the selected
   ' color.
   Form1.BackColor = CommonDialog1.Color
   Exit Sub

ErrHandler:
   ' User pressed Cancel button.
   Exit Sub
End Sub

0
 

Author Comment

by:spardog
ID: 7189580
i know how to do that but i would prefer a way to get the combo box with the color names and color samples next to them.
0
 
LVL 39

Expert Comment

by:appari
ID: 7189600
then may be this is what you are looking for

http://www.freevbcode.com/ShowCode.Asp?ID=4198
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 8061425
Hi spardog,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept appari's comment(s) as an answer.

spardog, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 8186090
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now