What is Visual Basic?
• Visual Basic is a tool that allows you to develop Windows (Graphic User Interface - GUI) applications. The applications have a familiar appearance to the user.
• Visual Basic is event-driven, meaning code remains idle until called upon to respond to some event (button pressing, menu selection, ...). Visual Basic is governed by an event processor. Nothing happens until an event is detected. Once an event is detected, the code corresponding to that event (event procedure) is executed. Program control is then returned to the event processor.
Application (Project) is made up of:
* Forms - Windows that you create for user interface
* Controls - Graphical features drawn on forms to allow user interaction (text boxes, labels, scroll bars, command buttons, etc.) (Forms and Controls are objects.)
* Properties - Every characteristic of a form or control is specified by a property. Example properties include names, captions, size, color, position, and contents. Visual Basic applies default properties. You can change properties at design time or run time.
* Methods - Built-in procedure that can be invoked to impart some action to a particular object.
* Event Procedures - Code related to some object. This is the code that is executed when a certain event occurs.
* General Procedures - Code not related to objects. This code must be invoked by the application.
* Modules - Collection of general procedures, variable declarations, and constant definitions used by application.
Steps in Developing Application
• There are three primary steps involved in building a Visual Basic application:
1. Draw the user interface
2. Assign properties to controls
3. Attach code to controls
We’ll look at each step.
Drawing the User Interface and Setting Properties
• Visual Basic operates in three modes.
Design mode - used to build application
Run mode - used to run the application
Break mode - application halted and debugger is available
We focus here on the design mode.
• Six windows appear when you start Visual Basic.
1 The Main Window consists of the title bar, menu bar, and toolbar. The title bar indicates the project name, the current Visual Basic operating mode, and the current form. The menu bar has drop-down menus from which you control the operation of the Visual Basic environment. The toolbar has buttons that provide shortcuts to some of the menu options. The main window also shows the location of the current form relative to the upper left corner of the screen (measured in twips) and the width and length of the current form.
2 The Form Window is central to developing Visual Basic applications. It is where you draw your application.
3 The Toolbox is the selection menu for controls used in your application.
4 The Properties Window is used to establish initial property values for objects. The drop-down box at the top of the window lists all objects in the current form. Two views are available: Alphabetic and Categorized. Under this box are the available properties for the currently selected object.
5 The Form Layout Window shows where (upon program execution) your form will be displayed relative to your monitor’s screen:
6 The Project Window displays a list of all forms and modules making up your application. You can also obtain a view of the Form or Code windows (window containing the actual Basic coding) from the Project window.
• As mentioned, the user interface is ‘drawn’ in the form window. There are two ways to place controls on a form:
1. Double-click the tool in the toolbox and it is created with a default size on the form. You can then move it or resize it.
2. Click the tool in the toolbox, then move the mouse pointer to the form window. The cursor changes to a crosshair. Place the crosshair at the upper left corner of where you want the control to be, press the left mouse button and hold it down while dragging the cursor toward the lower right corner. When you release the mouse button, the control is drawn.
• To move a control you have drawn, click the object in the form window and drag it to the new location. Release the mouse button.
• To resize a control, click the object so that it is select and sizing handles appear. Use these handles to resize the object.
For More: Go Googling
Visual Basic
• Visual Basic is a tool that allows you to develop Windows (Graphic User Interface - GUI) applications. The applications have a familiar appearance to the user.
• Visual Basic is event-driven, meaning code remains idle until called upon to respond to some event (button pressing, menu selection, ...). Visual Basic is governed by an event processor. Nothing happens until an event is detected. Once an event is detected, the code corresponding to that event (event procedure) is executed. Program control is then returned to the event processor.
Application (Project) is made up of:
* Forms - Windows that you create for user interface
* Controls - Graphical features drawn on forms to allow user interaction (text boxes, labels, scroll bars, command buttons, etc.) (Forms and Controls are objects.)
* Properties - Every characteristic of a form or control is specified by a property. Example properties include names, captions, size, color, position, and contents. Visual Basic applies default properties. You can change properties at design time or run time.
* Methods - Built-in procedure that can be invoked to impart some action to a particular object.
* Event Procedures - Code related to some object. This is the code that is executed when a certain event occurs.
* General Procedures - Code not related to objects. This code must be invoked by the application.
* Modules - Collection of general procedures, variable declarations, and constant definitions used by application.
Steps in Developing Application
• There are three primary steps involved in building a Visual Basic application:
1. Draw the user interface
2. Assign properties to controls
3. Attach code to controls
We’ll look at each step.
Drawing the User Interface and Setting Properties
• Visual Basic operates in three modes.
Design mode - used to build application
Run mode - used to run the application
Break mode - application halted and debugger is available
We focus here on the design mode.
• Six windows appear when you start Visual Basic.
1 The Main Window consists of the title bar, menu bar, and toolbar. The title bar indicates the project name, the current Visual Basic operating mode, and the current form. The menu bar has drop-down menus from which you control the operation of the Visual Basic environment. The toolbar has buttons that provide shortcuts to some of the menu options. The main window also shows the location of the current form relative to the upper left corner of the screen (measured in twips) and the width and length of the current form.
2 The Form Window is central to developing Visual Basic applications. It is where you draw your application.
3 The Toolbox is the selection menu for controls used in your application.
4 The Properties Window is used to establish initial property values for objects. The drop-down box at the top of the window lists all objects in the current form. Two views are available: Alphabetic and Categorized. Under this box are the available properties for the currently selected object.
5 The Form Layout Window shows where (upon program execution) your form will be displayed relative to your monitor’s screen:
6 The Project Window displays a list of all forms and modules making up your application. You can also obtain a view of the Form or Code windows (window containing the actual Basic coding) from the Project window.
• As mentioned, the user interface is ‘drawn’ in the form window. There are two ways to place controls on a form:
1. Double-click the tool in the toolbox and it is created with a default size on the form. You can then move it or resize it.
2. Click the tool in the toolbox, then move the mouse pointer to the form window. The cursor changes to a crosshair. Place the crosshair at the upper left corner of where you want the control to be, press the left mouse button and hold it down while dragging the cursor toward the lower right corner. When you release the mouse button, the control is drawn.
• To move a control you have drawn, click the object in the form window and drag it to the new location. Release the mouse button.
• To resize a control, click the object so that it is select and sizing handles appear. Use these handles to resize the object.
For More: Go Googling
Visual Basic
0 comments :
Post a Comment