Results 1 to 3 of 3

Thread: colored boxes in a combo box

  1. #1
    Guest

    Question

    hi,
    is there a way to put colored boxes (like in microsoft frontpage, i don't know any other program that do this) inside a combo box?

    it will look like this:

    --------------------------
    |combo blah blah|
    --------------------------
    |[.].red................|
    |[.].blue..............|
    |[.].green............|
    |[.].custome........|
    --------------------------
    (space where dot is)

    and in the last box (custome) i activate a color choosing dialog and the box changes to that color..

    this should work some how with the commond color sialog, it wont work wit an image combo because there are no images, just colored boxes. (that can change to the color of my
    choice). if you have internet explorer, then you probrbly have frontpage too, look for it, it will explain everything better then i can.

    thanks..

  2. #2
    Hyperactive Member Asaf_99's Avatar
    Join Date
    Jul 2000
    Location
    Israel
    Posts
    335
    On a form insert an ImageList and an ImageCombo.

    1. Set the ImageList's Size property to 16x16.
    2. Set the ImageCombo's Image List propert to ImageList1.
    3. Insert some images in it (just jot some colors in MS Paint or whatever.
    4. Use this code:
    Code:
    ImageCombo1.ComboItems.Add , , "Blue", 1
    ImageCombo1.ComboItems.Add , , "Red", 2
    ImageCombo1.ComboItems.Add , , "Green", 3
    ImageCombo1.ComboItems.Add , , "Yellow", 4
    'The numbers after the text is the index numbers of the images in the ImageList Control.
    Hope I helped!
    Asaf Sagi

    ICQ: 61917199
    E-Mail: [email protected]

  3. #3
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    Hey I found something you might want to see...
    I think with a bit modifications it can be placed in a ComboBox, or in any case in a command button... take a look at it!

    http://www.mvps.org/vbnet/code/neet/colourselect.htm
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width