2 questions...
I'm trying to create a setup form where a user can select a color, the code would save the hex value in a field and an ASP page would read thid field to color the text applicable...
This is what I have...
Private Sub Command1_Click()
CommonDialog1.flags = cdlCCRGBInit
CommonDialog1.ShowColor
text1.ForeColor = CommonDialog1.Color
Dim txt As String
txt = Hex(CommonDialog1.Color)
While Len(Trim(txt)) < 6 'Make sure number is 6 chars
txt = txt & "0"
Wend
text1.Caption = txt 'for test purposes
End Sub
1.
I tried checking the result on an HTML page but sometimes I get the correct number which would display the correct color, sometimes I don't(???).
I also tried leaving txt as is from Hex(CommonDialog1.Color) and also adding the 0s to the beginning of the string. Same result, sometimes the number's good, sometimes not.
2.
The above constant for Flags, cdlCCRGBInit, displays a dialog with all possible colors on my system, if I use cdlCCPreventFullOpen, only the custom colors is disabled. What I would like to have is a dialog like the one found in Display Properties->Appearance->Color, which is much neater. Anyone know how I can get this one to display instead?
Thanks in advance
I'm trying to create a setup form where a user can select a color, the code would save the hex value in a field and an ASP page would read thid field to color the text applicable...
This is what I have...
Private Sub Command1_Click()
CommonDialog1.flags = cdlCCRGBInit
CommonDialog1.ShowColor
text1.ForeColor = CommonDialog1.Color
Dim txt As String
txt = Hex(CommonDialog1.Color)
While Len(Trim(txt)) < 6 'Make sure number is 6 chars
txt = txt & "0"
Wend
text1.Caption = txt 'for test purposes
End Sub
1.
I tried checking the result on an HTML page but sometimes I get the correct number which would display the correct color, sometimes I don't(???).
I also tried leaving txt as is from Hex(CommonDialog1.Color) and also adding the 0s to the beginning of the string. Same result, sometimes the number's good, sometimes not.
2.
The above constant for Flags, cdlCCRGBInit, displays a dialog with all possible colors on my system, if I use cdlCCPreventFullOpen, only the custom colors is disabled. What I would like to have is a dialog like the one found in Display Properties->Appearance->Color, which is much neater. Anyone know how I can get this one to display instead?
Thanks in advance