By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,554 Members | 1,146 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,554 IT Pros & Developers. It's quick & easy.

Visual Basic Help Please

P: 3
Hi there- I am trying to create a program and I am very new at this! Please help.
Using the mouse up and mouse down event I need to draw lines. The lines will begin where the mouse is pressed down and will end where it is released. Then I need to save the X and Y values of the mouse location when a button is pressed in two form level variables. In the mouse up event I need to create a Pen and use the locations from both the mouse down and mouse up to draw a line that connects to points. I really need help with this!!
Nov 20 '06 #1
Share this Question
Share on Google+
2 Replies


sashi
Expert 100+
P: 1,754
Hi there- I am trying to create a program and I am very new at this! Please help.
Using the mouse up and mouse down event I need to draw lines. The lines will begin where the mouse is pressed down and will end where it is released. Then I need to save the X and Y values of the mouse location when a button is pressed in two form level variables. In the mouse up event I need to create a Pen and use the locations from both the mouse down and mouse up to draw a line that connects to points. I really need help with this!!
Hi there,

Have you started coding yet? Please post your code segment in your next post, will help you to validate your code. Good luck & take care.
Nov 20 '06 #2

P: 3
Hi there,

Have you started coding yet? Please post your code segment in your next post, will help you to validate your code. Good luck & take care.
This is what I have so far

'create a graphics object to use
Dim mygraphicobject As Graphics = CreateGraphics()
'create an empty bitmap object
Dim mybitmap As New Bitmap(200, 200)
Dim X As Integer = 100
Dim Y As Integer = 100
Dim blnstop As Boolean
Dim intX As Integer
Dim intY As Integer
Dim g As Graphics = Me.creategraphics


Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
'draw mybitmap
mygraphicobject.DrawImage(mybitmap, X, Y, mybitmap.Width, _
mybitmap.Height)
Nov 20 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.