|
<Previous lesson
| Table of Content | Content
of this Chapter | Next lesson>
Click here to download the code
- In the Toolbox, Right click and a pop up menu will be shown. You
choose Components. A dialog window will appear. In the control Tab
of the dialog, scroll down and find Microsoft Common Dialog Control.
Check the Checkbox and press OK. See that the Common Dialog control
is added to your toolbox
- Drag and drop the Common Dialog control into frmController.
- Add CommandButton inside Frame1 in the frmController, change the
Name property into cmdColor. Change the Style property into Graphical.
Change the BackColor property into any color you want. Delete the
Caption property (make it empty).
- Double click the cmdColor and add code below
Private Sub cmdColor_Click()
CommonDialog1.ShowColor
cmdColor.BackColor = CommonDialog1.color
frmMap.MYCOLOR = cmdColor.BackColor
End Sub
Remember that we have declared public variable
MYCOLOR in frmMap.
-
Now run the program and draw manually. Change
the color of the cmdColor in frmController and see what happen to
the drawing color in frmMap.
<Previous lesson
| Table of Content | Content
of this Chapter | Next lesson>
|