Results 1 to 6 of 6

Thread: [RESOLVED] [2005] Color dialog -- show current color?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2007
    Posts
    751

    Resolved [RESOLVED] [2005] Color dialog -- show current color?

    I know that with some of the programs I use, when you click on an item to change it's color, the color dialog will actually show the current color and it's rgb value.

    I'd like to do that in my application but can't find the answer on how you do it.

    To change the backcolor on a textbox, the user double clicks the box and it shows the color dialog.

    I think I have all the properties set right -- fully open to show custom colors etc.

    BUT, it doesn't show the current color.

    They all have 0 0 0 rgb.

    THANKS for the help.

  2. #2
    PowerPoster sparrow1's Avatar
    Join Date
    May 2005
    Location
    Globetrotter
    Posts
    2,820

    Re: [2005] Color dialog -- show current color?

    Hi,

    Did you tryed this;

    vb Code:
    1. TextBox1.Backcolor = ColorDialog1.Color

    Wkr,

    sparrow1
    Wkr,
    sparrow1

    If I helped you, don't forget to Rate my post. Thank you

    I'm using Visual Studio.Net 2003 and
    2005
    How to learn VB.Net Create setup with VB 2005 Drawing for beginners VB.Net Tutorials GDI+ Tutorials
    Video's for beginners

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2007
    Posts
    751

    Re: [2005] Color dialog -- show current color?

    I'm not having a problem with the chosen dialog color.

    What I mean is, AFTER it has a color in it.

    Let's say I go back and double click the textbox to perhaps change the color.

    I've seen some programs (maybe they were graphics -- can't remember) where
    once you bring up the color dialog, it will actually show you the value of the current color in RGB.

    That's what I want to achieve.

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2007
    Posts
    751

    Re: [2005] Color dialog -- show current color?

    Or maybe what you're saying is that part of my IF routine with the box, I should make the color dialog color the textbox color?

    so it would be the reverse?

    colordialog1.color = textbox1.color

    I'll try it.

  5. #5
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: [2005] Color dialog -- show current color?

    did that work?

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jun 2007
    Posts
    751

    Re: [2005] Color dialog -- show current color?

    Yeah, that did it.

    But should be put in front of the color dialog IF routine. duh.

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