| 1 |
Imports System |
| 2 |
Imports System.Drawing |
| 3 |
Imports System.Windows.Forms |
| 4 |
|
| 5 |
Public Class HelloWindows |
| 6 |
|
| 7 |
Inherits Form |
| 8 |
|
| 9 |
Private lblHelloWindows As Label |
| 10 |
|
| 11 |
Public Shared Sub Main( ) |
| 12 |
Application.Run(New HelloWindows( )) |
| 13 |
End Sub |
| 14 |
|
| 15 |
Public Sub New( ) |
| 16 |
|
| 17 |
lblHelloWindows = New Label( ) |
| 18 |
With lblHelloWindows |
| 19 |
.Location = New Point(37, 31) |
| 20 |
.Size = New Size(392, 64) |
| 21 |
.Font = New Font("Arial", 36) |
| 22 |
.Text = "Hello, Windows!" |
| 23 |
.TabIndex = 0 |
| 24 |
.TextAlign = ContentAlignment.TopCenter |
| 25 |
End With |
| 26 |
|
| 27 |
Me.Text = "Programming Visual Basic .NET" |
| 28 |
AutoScaleBaseSize = New Size(5, 13) |
| 29 |
FormBorderStyle = FormBorderStyle.FixedSingle |
| 30 |
ClientSize = New Size(466, 127) |
| 31 |
|
| 32 |
Controls.Add(lblHelloWindows) |
| 33 |
|
| 34 |
End Sub |
| 35 |
|
| 36 |
End Class |
| 37 |
|
| 38 |
' From https://www.oreilly.com/library/view/programming-visual-basic/0596000936/ch01s03.html |
| 39 |
|