Results 1 to 4 of 4

Thread: Lines - where are they?

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2002
    Posts
    59

    Question Lines - where are they?

    Hi all,
    Does anyone know how I can draw a Line on a Form like you can in VB6? What is the .NET equivalent, I can't seem to find it?

    Thanks for your time

  2. #2
    Frenzied Member axion_sa's Avatar
    Join Date
    Jan 2002
    Location
    Joburg, RSA
    Posts
    1,724
    VB Code:
    1. Imports System
    2. Imports System.Windows.Forms
    3. Imports System.Drawing
    4. Public Module modmain
    5.    Sub Main()
    6.       'The KPD-Team 2001
    7.       'URL: [url]http://www.allapi.net/dotnet/[/url]
    8.       'E-Mail: [email][email protected][/email]
    9.       Dim theForm as MainForm = new MainForm()
    10.       theForm.Size = new Size(500, 350)
    11.       theForm.Text = "Visual Basic.NET"
    12.       theForm.ShowDialog()
    13.    End Sub
    14. End Module
    15. Public Class MainForm
    16. Inherits Form
    17.    Protected Overrides Sub OnPaint(e as PaintEventArgs)
    18.       e.Graphics.Clear(Me.BackColor)
    19.       e.Graphics.DrawLine(new Pen(Color.Blue), 0, 0, Me.ClientSize.Width, Me.ClientSize.Height)
    20.    End Sub
    21. End Class

  3. #3
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    the answer like the guy up said is GDI+...that means graphic device interface that is what makes about all graphics in windows

    u can find it in the Drawing and Drawing2d namespaces

  4. #4

    Thread Starter
    Member
    Join Date
    Jul 2002
    Posts
    59
    thanks guys

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