|
-
Oct 20th, 2003, 03:23 PM
#1
Thread Starter
Fanatic Member
Convert this line of code from VB5 To .NET ??
What do I need to do to convert this to .NET. The update wizard wouldn't touch it.
pPaintInto.Line (PosX, PosY1) - (PosX, PosY2)
-
Oct 20th, 2003, 04:06 PM
#2
Lively Member
-
Oct 20th, 2003, 04:54 PM
#3
yay gay
that is not possible to copy like that
you must do it the .net way
\m/  \m/
-
Oct 20th, 2003, 05:14 PM
#4
Thread Starter
Fanatic Member
?
you must do it the .net way
I reallize that. Isn't that the question? How do you do it the .NET way?
pPaintInto.Line (PosX, PosY1) - (PosX, PosY2)
pPaintInto is a picture box that something is being drawn in.
I realize this is not much code to demonstrate. It appears there is no direct crossover from .line in VB5/6 to .NET.
-
Oct 20th, 2003, 05:23 PM
#5
You'd have to use the paint event of the picturebox to persist the drawing. Also in this example I provided values for the position variables which you would have to change.
VB Code:
Private Sub pPaintInto_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles pPaintInto.Paint
'pPaintInto.Line (PosX, PosY1) - (PosX, PosY2)
Dim posx As Single = 10
Dim posy1 As Single = 100
Dim posy2 As Single = 115
e.Graphics.DrawLine(New Pen(Color.Black), posx, posy1, posx, posy2)
End Sub
That draws a line in a vertical direction. You'll have to tweak it from there.
-
Oct 20th, 2003, 06:11 PM
#6
Thread Starter
Fanatic Member
Thank you!
What does the (PosX, PosY1) - (PosX, PosY2) mean? Is this a minus sign in VB5/6?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|