Make A Pop Up Color Selector
With the Common Dialog Control
you can easily add a pop up color selector to your application.
code will pop up
color selector, and will paint the form with the selected color.
Add 1 Common Dialog Control to your form (From VB menu
choose Project->Components..., then mark the Microsoft Common Dialog Control check box, and press OK. Now drag
the new control to your form).
' The following line says: if the user
will press the cancel Button,
' treat it like if an error occurred in
' If an error occurred in the program, jump to the
' CancelPressed part of the program,
On Error GoTo CancelPressed
' Pop up the Color Selector
' Paint the from with the chosen
' CommonDialog1.Color holds the color that the user has
' exit the Command1_Click()
' If the user pressed the cancel button an error was
' the program had jumped to here.
' if the user didn't
press the cancel button, the program doesn't apply this
' lines because
it already has exited this sub from the "Exit Sub" line
MsgBox "You pressed Cancel"