Color Dialog

Using color dialog to select color and get rgb values
place a color dialog on to the form

If dlgcolor.ShowDialog() = Windows.Forms.DialogResult.OK Then
PictureBoxcolor.BackColor = dlgcolor.Color
sbred.Value = dlgcolor.Color.R.ToString
sbgreen.Value = dlgcolor.Color.G.ToString
sbblue.Value = dlgcolor.Color.B.ToString
txtred.Text = dlgcolor.Color.R.ToString
txtgreen.Text = dlgcolor.Color.G.ToString
txtblue.Text = dlgcolor.Color.B.ToString

End If


Comments

Author: srinivasa reddy tatikonda09 Jan 2009 Member Level: Silver   Points : 2

Private Sub btnPickColor_Click(ByVal sender As _
System.Object, _
ByVal e As System.EventArgs) Handles btnPickColor.Click
dlgColor.Color = Me.BackColor
If dlgColor.ShowDialog() = DialogResult.OK Then
btnPickColor.BackColor = dlgColor.Color
Me.BackColor = dlgColor.Color
End If
End Sub
Best Regards

Srinivasa Reddy



  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:
    Email: