VB6 - Painting Program

All tutorials created in VB6 to be posted in here.
3 posts Page 1 of 1
Contributors
GoodGuy17
Coding God
Coding God
Posts: 1610
Joined: Mon Sep 07, 2009 12:25 am

VB6 - Painting Program
GoodGuy17
Hello, I am going to teach you how to make a painting program in Visual Basic 6. First, open Visual Basic 6 and select "Standard Exe" and click "OK". Now, get a picturebox from the toolbox to the left. Make it as big as you want, and then go to it's properties at the bottom right hand side of the Visual Basic program and change the "Name" property and change it to picDraw. Change the "Appearance" property to 1-Flat. Next, Make a button and go to it's properties and change the "Caption" property to Blue. Now, this is just a simple tutorial, so I am just going to make one option besides painting. OK, right-click the form and click "View Code". Go to the General Declarations section of the form and type:
Code: Select all
Dim Drawing As Boolean
Now, go to the picDraw MouseDown part of the form and type:
Code: Select all
Drawing = True
picDraw.CurrentX = X
picDraw.CurrentY = Y
Go to the picDraw MouseMove part and type:
Code: Select all
If Drawing = True Then
picDraw.Line - (X, Y), picDraw.ForeColor
End If
Now, go to the picDraw MouseUp and type:
Code: Select all
Drawing = False
Go to the Command1 Click and type:
Code: Select all
picDraw.ForeColor = vbBlue
Finally, go to the Form Load and type:
Code: Select all
Drawing = False
I hope this tutorial helped you!
~GoodGuy17~ :D
User avatar
Nery
Co-Admin Moderator
Co-Admin Moderator
Posts: 1117
Joined: Mon Sep 07, 2009 8:11 pm

Re: VB6 - Painting Program
Nery
Awh, I'll try to convert this to VB.NET tomorrow morning and I'll post here :D
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4389
Joined: Tue Aug 04, 2009 1:47 am

Re: VB6 - Painting Program
CodenStuff
Hello,

Great tutorial submission GoodGuy17.

Keep it up cooll;
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
3 posts Page 1 of 1
Return to “VB6 Tutorials”