VB6 - Updated Paint Tutorial
All tutorials created in VB6 to be posted in here.
6 posts
Page 1 of 1
Hello,
This tutorial assumes you have a basic knowledge of Visual Basic 6 and have made a few apps with it.
I am going to tell you how to make a more advanced painting application in Visual Basic 6.
This time it will be easier to follow as I will use my Step-By-Step thing.
NOTE: To make this painting application, you must NOT have Visual Basic 6 Portable. VB6 MUST be installed.
Here we go:
1. Open VB6 and create a new Standard Exe project.
2. Resize your form and rename it.
3. Add the following:
1 Picturebox - Name: Paint Appearance: 0-Flat
3 Buttons - Names: cmdColor, cmdSize, cmdExit Captions: Color, Size, Exit
1 Commondialog control
4. Now all we need is the code! Here it is:
Enjoy!
~GoodGuy17~
This tutorial assumes you have a basic knowledge of Visual Basic 6 and have made a few apps with it.
I am going to tell you how to make a more advanced painting application in Visual Basic 6.
This time it will be easier to follow as I will use my Step-By-Step thing.
NOTE: To make this painting application, you must NOT have Visual Basic 6 Portable. VB6 MUST be installed.
Here we go:
1. Open VB6 and create a new Standard Exe project.
2. Resize your form and rename it.
3. Add the following:
1 Picturebox - Name: Paint Appearance: 0-Flat
3 Buttons - Names: cmdColor, cmdSize, cmdExit Captions: Color, Size, Exit
1 Commondialog control
4. Now all we need is the code! Here it is:
Code: Select all
5. That's it! 5 easy steps! Run your program, and if it works you are a good reader!Dim Drawing As Boolean
Private Sub cmdColor_Click()
CommonDialog1.CancelError = True
CommonDialog1.Flags = CC_RGBINIT Or CC_FULLOPEN
CommonDialog1.Action = 3
Paint.ForeColor = CommonDialog1.Color
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdSize_Click()
Dim strSize
strSize = InputBox("Enter a value.")
Paint.DrawWidth = strSize
End Sub
Private Sub Form_Load()
Drawing = False
End Sub
Private Sub Paint_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Drawing = True
Paint.CurrentX = X
Paint.CurrentY = Y
End Sub
Private Sub Paint_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Drawing = True Then
Paint.Line -(X, Y), Paint.ForeColor
End If
End Sub
Private Sub Paint_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Drawing = False
End Sub
Enjoy!
~GoodGuy17~

this is really nice......but i need to insert shapes in it ...
like circle or square or anything else...so can you please help me out with this ???
like circle or square or anything else...so can you please help me out with this ???
Sorry, I'm not sure how to do this, I haven't used VB6 in quite awhile.
(sorry for bump)
(sorry for bump)
This article shows how to draw circles and rectangles in VB6: http://msdn.microsoft.com/en-us/library ... s.80).aspx
6 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023