Professional Documents
Culture Documents
Contents
1. Introduction to programming with Visual Basic
2. Hello World Program
3. Difference between Console. Write () and Console.
WriteLine ()
4. To change the display window, you can use the
following console commands
Prepared by P a g e |1
Subject Grade Date Block week Unit/Lesson/Topic Study sheet
ICT 9 2 1 introduction to V.B 1 out of 16
• Sequence instructions within a text-based programming
Objective:
language to produce a program
Student Name: ………………………………………………………………………………………………………………………. Class 9
Prepared by P a g e |2
Subject Grade Date Block week Unit/Lesson/Topic Study sheet
ICT 9 2 1 introduction to V.B 1 out of 16
• Sequence instructions within a text-based programming
Objective:
language to produce a program
Student Name: ………………………………………………………………………………………………………………………. Class 9
• A console application doesn’t have a user interface, so the first thing you’ll see is the
code editor’s window.
• The first line is telling us we're creating a module. It's just a way how we structure code
in VB.NET.
• The key will be the Sub Main() method for us, we'll write our code between this line and
the line with End Sub, i.e. the body. SubMain() is a reserved word, and Visual Basic
knows that this method must be executed as first after the application starts.
The second important element in the window is a green " " button in the upper bar, which
compiles and runs our program. You can try it, but our program will not do anything, just turn
terminate right away. You can also run the program with the F5 keyboard shortcut.
Prepared by P a g e |3
Subject Grade Date Block week Unit/Lesson/Topic Study sheet
ICT 9 2 1 introduction to V.B 1 out of 16
• Sequence instructions within a text-based programming
Objective:
language to produce a program
Student Name: ………………………………………………………………………………………………………………………. Class 9
Prepared by P a g e |4
Subject Grade Date Block week Unit/Lesson/Topic Study sheet
ICT 9 2 1 introduction to V.B 1 out of 16
• Sequence instructions within a text-based programming
Objective:
language to produce a program
Student Name: ………………………………………………………………………………………………………………………. Class 9
Prepared by P a g e |5
Subject Grade Date Block week Unit/Lesson/Topic Study sheet
ICT 9 2 1 introduction to V.B 1 out of 16
• Sequence instructions within a text-based programming
Objective:
language to produce a program
Student Name: ………………………………………………………………………………………………………………………. Class 9
Module Module1
Sub Main()
Console.WriteLine("Hello
World!")
Console.WriteLine ("Hello ICT")
Console.ReadLine()
End Sub
End Module
Console.Beep()
• Console.Beep(): Plays the sound of a beep through the console speaker.
Console.Beep (frequency As Integer, duration As Integer)
Play the sound of a beep of a specified frequency and duration through the console speaker
Example:
Module Module1
Sub Main()
Console.Beep (200, 5000)
End Sub
End Module
Prepared by P a g e |6
Subject Grade Date Block week Unit/Lesson/Topic Study sheet
ICT 9 2 1 introduction to V.B 1 out of 16
• Sequence instructions within a text-based programming
Objective:
language to produce a program
Student Name: ………………………………………………………………………………………………………………………. Class 9
To change the display window, you can use the following console commands:
Module Module1
Sub Main)(
Console.Title = "User Define Console"
Console.BackgroundColor = ConsoleColor. DarkGray
Console.ForegroundColor = ConsoleColor.White
Console.WindowHeight = Console.LargestWindowHeight - 30
Console.WindowWidth = Console.LargestWindowWidth - 100
Console.Clear)(
Console.WriteLine("While Visual Studio .NET is the most popular method of
developing .NET applications.")
Console.ReadLine)(
End Sub
End Module