|
|
Title | Use the color selection dialog in VB .NET |
Keywords | color, select color, pick color, color selection, color selection dialog, VB.NET |
Categories | Graphics, VB.NET, Software Engineering |
|
|
Add a ColorDialog control to the form. To use it, set its Color property to the color you want it to have initially selected. Then call the control's ShowDialog method. If the method returns DialogResult.OK, do something with the color that the user selected.
|
|
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
|
|
|
|
|
|