Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Colordialog returning bogus rgb values.

Status
Not open for further replies.

z0r

Technical User
Mar 12, 2007
6
CA

Hello

Im having an issue with colordialog. I want to click a color and have the rgb values returned. I expect each should return a value of 0-255. However it only ever returns 0 32 64 128 or 255. any ideas?



Private Sub btnColor1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnColor1.Click

If ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then

txtCol1.BackColor = ColorDialog1.Color
txtCol1.Text = txtCol1.BackColor.B
End If
End Sub 'button1_Click
 
Try selecting a custom color...
and not from the "list", and see the range now
 
yes thank you. apparently Im not as bright as I thought :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top