Results 1 to 6 of 6

Thread: Convert this line of code from VB5 To .NET ??

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    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)

  2. #2
    Lively Member Edilson's Avatar
    Join Date
    Aug 2000
    Location
    Orlando
    Posts
    81
    What is pPaintInto ???

  3. #3
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    that is not possible to copy like that

    you must do it the .net way
    \m/\m/

  4. #4

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    ?

    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.

  5. #5
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    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:
    1. Private Sub pPaintInto_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles pPaintInto.Paint
    2.         'pPaintInto.Line (PosX, PosY1) - (PosX, PosY2)
    3.         Dim posx As Single = 10
    4.         Dim posy1 As Single = 100
    5.         Dim posy2 As Single = 115
    6.         e.Graphics.DrawLine(New Pen(Color.Black), posx, posy1, posx, posy2)
    7.     End Sub
    That draws a line in a vertical direction. You'll have to tweak it from there.

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830
    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
  •  



Click Here to Expand Forum to Full Width