Resources » Code Snippets » VB.NET Syntax

Color Dialog


Posted Date: 11-Nov-2008  Last Updated:   Category: VB.NET Syntax    
Author: Member Level: Gold    Points: 4



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


Did you like this resource? Share it with your friends and show your love!

Responses to "Color Dialog"
Author: srinivasa reddy tatikonda    09 Jan 2009Member 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



Feedbacks      

Post Comment:




  • 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:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Submit Article     Return to Article Index

    Subscribe to Subscribers
    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Talk to Webmaster Tony John

    Online Members

    More...
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India