What do I need to do to convert this to .NET. The update wizard wouldn't touch it.
pPaintInto.Line (PosX, PosY1) - (PosX, PosY2)
Printable View
What do I need to do to convert this to .NET. The update wizard wouldn't touch it.
pPaintInto.Line (PosX, PosY1) - (PosX, PosY2)
What is pPaintInto ???
that is not possible to copy like that
you must do it the .net way
I reallize that. Isn't that the question? How do you do it the .NET way?Quote:
you must 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.
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.
That draws a line in a vertical direction. You'll have to tweak it from there.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
Thank you!
What does the (PosX, PosY1) - (PosX, PosY2) mean? Is this a minus sign in VB5/6?