467,879 Members | 1,080 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,879 developers. It's quick & easy.

Visual Basic Help Please

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
  • viewed: 906
Share:
2 Replies
sashi
Expert 1GB
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
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.

Similar topics

3 posts views Thread by wolfing1 | last post: by
8 posts views Thread by delete table with Visual Basic 6 | last post: by
2 posts views Thread by frossberg | last post: by
4 posts views Thread by junaidnaseer | last post: by
8 posts views Thread by WT | last post: by
4 posts views Thread by Goran Djuranovic | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.