<
Previous
|
Next
|
VB Tutorial
|
Contents
>
VB Picture Box
We start our project by adding picture box into our form, to make it resizable and become a drawing canvas. Click here to download the code
- Open a new Standard Exe Project
- Change the Name Property of Form1 into frmMap , then the Caption property into My Canvas .
- Drag and drop Picture Box from the Toolbox into the form frmMap .
- Change the Name property into picMap
- Change the AutoRedraw property to True. This will automatically redraw your picture again after other form goes over your picture box.
-
Change the
AutoSize
Property to True so that the
picture box will be also be resize when we change the size of the
form. Type this code in the
Form_Resize
:
Private Sub Form_Resize()picMap.Width = Me.Width - 120End Sub
picMap.Height = Me.Height - 400