Monday, December 10, 2012

Graphics Method in visual basic


Private Sub Form_Load()
DrawWidth = 2
End Sub
Private Sub CmdSQUARE_Click()
Me.Line (300, 300)-Step(2000, 2000), vbRed, B
Me.Line (400, 400)-Step(1800, 1800), , B
Me.Line (500, 500)-Step(1600, 1600), , B
Me.Line (600, 600)-Step(1400, 1400), vbBlue, B
Me.Line (700, 700)-Step(1200, 1200), , B
Me.Line (800, 800)-Step(1000, 1000), , B
Me.Line (900, 900)-Step(800, 800), vbGreen, B
End Sub
Private Sub CmdCircle_Click()
Circle (3500, 1500), 800, RGB(225, 0, 225)
Circle (3500, 1500), 600, RGB(0, 225, 225)
Circle (3500, 1500), 400, RGB(225, 225, 0)
End Sub

Private Sub CmdExit_Click()
End
End Sub

 



 Output







Note:- Please set some property of your control like caption or id corresponding to your control