CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: Color Combo Box

  1. #1
    Join Date
    Jun 2000
    Location
    Nepal
    Posts
    108

    Color Combo Box

    How do I create a color combo box in which I can load colors at runtime and from which the user can select one.


  2. #2
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Color Combo Box

    Sounds to me like you need to use the ImageComboBox control. I have a sample, but its too complex to post here. Send me your EMail address in a private memo and I will send you a .ZIP file or try using the CommonDialog .ShowColor method

    John G

  3. #3
    Join Date
    Jun 2000
    Location
    Nepal
    Posts
    108

    Re: Color Combo Box

    I have to make the user choose from three or four colors, so the Commondialog option is not feasible. I tried using the ImageCombo but it allows its contents to be derived from an imagelist. I know the three or four colors only during run time.


  4. #4
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210

    Re: Color Combo Box

    You should be able to load the ImageComboBox at run time with only the colors you want with no problem, but I might suggest using Pictureboxes inside a Frame. Merely set the BackColor of the PictureBox to the color of your choosing and allow the user to click the one they want. That essentially is what the CommonDialog.ShowColor does.

    John G

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

Featured