Solved

Color Selection Combo Box

Posted on 2002-07-30
5
304 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

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

717 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