Solved

Color Selection Combo Box

Posted on 2002-07-30
5
303 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…

733 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