I'm teaching myself vb.net (in the hopes of landing a job after staying home for the past 6 1/2 years to raise my children !). I am following a tutorial online from Programmer's Heaven, and I believe I typed in the code (using Visual Studio) exactly as it's presented, but I get a blank WinForm, ie. it doesn't contain my title (just says Form1) nor my text (it's a completely empty window).
Here's the code. Please excuse the comments; they're my learning aid :
Imports System ' Application class is defined here
' Also need references to these assemblies by adding references in project
Imports System.Windows.Forms ' Base classes for Windows controls
Imports System.Drawing ' For drawing controls
Class Test
Public Sub main()
Application.Run(New MyForm())
End Sub
End Class
Class MyForm
Inherits Form
Public Sub New()
MyBase.New()
Me.Text = "Na, na, I'm learning vb.net!"
Me.Size = New Size(300, 300)
Dim lblGreeting As New Label()
lblGreeting.Text = "Hello WinForm"
lblGreeting.Location = New Point(100, 100)
Me.Controls.Add(lblGreeting)
End Sub
End Class
I did add the references to both System.Windows.Forms and Sytem.Drawing but something else must be wrong/missing.
Here's the website where the tutorial is:
http://www.programmersheaven.com/2/Les_VBNET_11_p1
Thanks in advance for your help.
Marlene
Here's the code. Please excuse the comments; they're my learning aid :
Imports System ' Application class is defined here
' Also need references to these assemblies by adding references in project
Imports System.Windows.Forms ' Base classes for Windows controls
Imports System.Drawing ' For drawing controls
Class Test
Public Sub main()
Application.Run(New MyForm())
End Sub
End Class
Class MyForm
Inherits Form
Public Sub New()
MyBase.New()
Me.Text = "Na, na, I'm learning vb.net!"
Me.Size = New Size(300, 300)
Dim lblGreeting As New Label()
lblGreeting.Text = "Hello WinForm"
lblGreeting.Location = New Point(100, 100)
Me.Controls.Add(lblGreeting)
End Sub
End Class
I did add the references to both System.Windows.Forms and Sytem.Drawing but something else must be wrong/missing.
Here's the website where the tutorial is:
http://www.programmersheaven.com/2/Les_VBNET_11_p1
Thanks in advance for your help.
Marlene