Solved

Color Selection Combo Box

Posted on 2002-07-30
5
300 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

772 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

12 Experts available now in Live!

Get 1:1 Help Now