PDA

Click to See Complete Forum and Search --> : Drawing on a Form


Brian M.
Jun 30th, 2008, 01:36 AM
This example uses circles and logic statements to re-size the amount of circles when you re-size the form. It assumes you have a form1. There is a huge difference on drawing to a form with vb.net. Check out this example on how to draw on a form with vb.net.

Form drawing for vb.net (http://www.vbforums.com/showthread.php?t=529373)


Private Sub Form_Load()
Cls
Dim r As Integer
r = 1
For i = 1 To Form1.ScaleWidth Step 5
If i <= Form1.ScaleWidth - r And Form1.ScaleHeight > r * 2 Then
Circle (i, Form1.ScaleHeight / 2), r, vbGreen
r = r + 1
End If
Next i
End Sub

Private Sub Form_Resize()
Cls
Dim r As Integer
r = 1
For i = 1 To Form1.ScaleWidth Step 5
If i <= Form1.ScaleWidth - r And Form1.ScaleHeight > r * 2 Then
Circle (i, Form1.ScaleHeight / 2), r, vbGreen
r = r + 1
End If
Next i
End Sub