Visual Basic (.NET): Difference between revisions

Content deleted Content added
Tag: Reverted
m Reverted edit by 103.178.78.199 (talk) to last version by HeyElliott
Line 207:
== Examples ==
 
=== Hello World! ===
 
==== Windows Forms Application ====
DIM "a","b","c" as integer
Requires a button called Button1.<syntaxhighlight lang="vb.net">
IF a<b
Public Class Form1
Print "a" & "is a smallest"
 
IF b<c
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Print "b" & "is a smallest"
MsgBox("Hello world!", MsgBoxStyle.Information, "Hello world!") ' Show a message that says "Hello world!".
Else
End Sub
Print "c" & "is smallest"
End IfClass
Else
 
Print "b" & "is a smallest"
</syntaxhighlight>
End If
[[File:Hello world! Window.jpg|thumb|Hello world! window]]
 
==== Console Application ====
<syntaxhighlight lang="vb.net>
Module Module1
 
Sub Main()
Console.WriteLine("Hello world!") ' Write in the console "Hello world!" and start a new line.
Console.ReadKey() ' The user must press any key before the application ends.
End Sub
End Module
 
</syntaxhighlight>
 
=== Speaking ===