Download presentation
Presentation is loading. Please wait.
1
Working with Forms in Visual Basic
2
The main characteristic of a Form is the title bar
3
CONTROL MENU Restore : Restores a maximized Form to the size it was before it was maximized; available only if the Form has been maximized. Move : Lets the user moves the Form around with the mouse Size : Lets the user resizes the control with the mouse Minimize: Minimizes the Form Maximize : Maximizes the Form Close : Closes the Form
4
Loading and Unloading Forms
Load and Unload statements in VB Load FormName Unload FormName
5
Showing and Hiding Forms
Show method is used to Show a Form FormName.Show The Hide method is used to hide a Form Me.Hide Me is the form name, Keyword
6
OBJECT PROPERTY SETTING Form Caption Name Form1 frm1 Form2 frm2 Form3 frm3 Label Click on a button to display a Form Label1
8
Variables
9
Variables Variables are the memory locations which are used to store values temporarily. Rules A variable name must begin with an alphabet letter and should not exceed 255 characters. It must be unique within the same scope. It should not contain any special character like %, &, !, or $.
10
Syntax Dim variable [As Type] Dim I as integer
Dim intInterestRate As Integer = 10
11
Scope of variables A variable is scoped to
procedure-level (local) -Global module-level – Local They can be declared with Dim and Static keywords.
12
Local Variables A local variable is one that is declared inside a procedure. Dim sum As Integer The local variables exist as long as the procedure in which they are declared, is executing.
13
Static Variables A static variable is declared as given below.
Static intPermanent As Integer Variables have a lifetime in addition to scope.
14
DATATYPES Numeric Data Types Non-numeric Data Types
Suffixes for Literals
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.