views:

35

answers:

1

how do i set the background color of my form to what the user picks from colordialog?

+2  A: 

Simply assign the BackColor property of the form with the value of the Color property of the ColorDialog:

Dim cd As New ColorDialog()
If cd.ShowDialog() = DialogResult.OK Then
    Me.BackColor = cd.Color
End If
Fredrik Mörk
cool, should i put this into the form load event?
I__
Only if you want the color dialog to show each time the form is displayed (which I doubt). Put a button or a menu item on the form instead, and put it in the click event of that control.
Fredrik Mörk