As it appears, color picking can also be done just by calling a ColorDialog box within the Click event of a control.
Here is a simple example with a standard button control placed on the MainForm and some code from the ColorPicker.vb control posted by Archie:
Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Button1.UseVisualStyleBackColor = False
Button1.Text = Button1.BackColor.ToString 'or use Button1.BackColor.Name
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim cDialog As New ColorDialog()
cDialog.Color = Button1.BackColor
If (cDialog.ShowDialog() = DialogResult.OK) Then
If Button1.BackColor <> cDialog.Color Then
Button1.BackColor = cDialog.Color
If (CInt(cDialog.Color.R) + CInt(cDialog.Color.G) + CInt(cDialog.Color.B)) > ((255I * 3I) \ 2I) Then
Button1.ForeColor = Color.Black
Else
Button1.ForeColor = Color.White
End If
Button1.Text = cDialog.Color.ToString 'or use cDialog.Color.Name
End If
End If
End Sub