Home » Category » Microsoft Visual Basic

Microsoft Visual Basic: Colour Dialog - Custom Colours not working... Help!

104| Mon, 03 Dec 2007 13:55:00 GMT| sciguyryan| Comments (4)
Hi everyone,

I am using the following code to show a Colour Dialog (Which works fine except for this one problem):

cdgMain.flags = cdlCCRGBInit Or cdlCCFullOpen
cdgMain.CancelError = False
cdgMain.ShowColor

Is there another flag I need to add to make the Custom Colours work or, is there something else I need to do.

At the moment all they do, whatever colour I select and say add to custom colours it just adds black instead.

Has anyone got any ideas that I could try to solve this?

Thanks for the help,

RyanJ

Keywords & Tags: colour, dialog, custom, colours, working, microsoft, visual basic, vb

URL: http://www.programmerbase.com/visual-basic/80734/
 
«« Prev - Next »» 4 helpful answers below.
At the moment all they do, whatever colour I select and say add to custom colours it just adds black instead.

Has anyone got any ideas that I could try to solve this?
Did you change the luminosity setting via the slider on the right-hand side of the dialog box? It often defaults to 0, which will result in Black regardless of what color you select in the palette.

Regards,

jlbeam | Mon, 03 Dec 2007 18:50:00 GMT |

OOOPs, that does seem to be the problem.

Do you happen to know if there is any way to set that slider to the middle by default?

Thanks for the help,

RyanJ

sciguyryan | Mon, 03 Dec 2007 18:51:00 GMT |

Do you happen to know if there is any way to set that slider to the middle by default?
Yeah, just set the cdlCCRGBInit flag and it will default to 120 (right in the middle of the slider). Example:

' Set cdlCCRGBInit flag. Color will default to Cyan.
CommonDialog1.Flags = cdlCCRGBInit

' Optionally specify a different default color.
CommonDialog1.Color = RGB(0, 0, 255)

Regards,

jlbeam | Mon, 03 Dec 2007 18:52:00 GMT |

Thank you jlbeam, that worked great :)

Thanks again for the help,

Cheers,

RyanJ

sciguyryan | Mon, 03 Dec 2007 18:53:00 GMT |

Microsoft Visual Basic Hot Answers

Microsoft Visual Basic New questions

Microsoft Visual Basic Related Categories