Really Simple VB.Net Question

rifter1818

Well-known member
Joined
Sep 11, 2003
Messages
255
Location
A cold dark place
How dyou print directly onto a form in vb.net, in vb6 the code would be
me.show
print "What a complicated process eh?"
now ive tryed using the built in converter but that doesnt do it....... help?!
 
you cant do it as simple as in VB6.... you need to handle the "Paint" Event of the Form and put your drawing code there..... I would recommend you taking a look at the System.Drawing-Namespace!

an example:

Code:
Public Class Form1
    Inherits System.Windows.Forms.Form

    Public Sub New()
         Me.Size = New System.Drawing.Size(300,300)
    End Sub

this is the Sub where the drawing takes place...
    Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
        Dim g As Graphics = e.Graphics
        g.DrawString("Hello World", Me.Font, Brushes.Black, 10, 10)
    End Sub

End Class

Hope this helps!

Andreas
 
Back
Top