30.07.2013 Views

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

Visual Basic.NET How to Program (PDF)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 4 Control Structures: Part 1 137<br />

With visual programming, the IDE actually generates program code that creates the GUI. This<br />

code contains instructions for creating the form and every control on it.<br />

Windows application code is contained in a class. Like modules, classes are logical groupings of<br />

procedures and data that simplify program organization.<br />

Using keyword Inherits <strong>to</strong> extend from class Form enables programmers <strong>to</strong> create forms<br />

quickly, without “reinventing the wheel.” Every Windows application consists of at least one class<br />

that Inherits from class Form in the System.Windows.Forms namespace.<br />

The region of collapsed code labelled Windows Form Designer generated code contains<br />

the code created by the IDE for the form and its controls, as well as code that enables the program<br />

<strong>to</strong> run.<br />

Forms and controls contain a set of default properties, which are displayed initially in the Properties<br />

window when a form or control is selected. These default properties provide the initial<br />

characteristics a form or control has when it is created.<br />

When a change is made in design mode, such as changing a property value, the Windows Form<br />

Designer creates code that implements the change.<br />

Often it is necessary <strong>to</strong> modify a property while a program is running. In Windows applications,<br />

such code is placed in a procedure that executes when the form is loaded, which can be created by<br />

double-clicking the form in design view.<br />

In <strong>Visual</strong> <strong>Basic</strong>, properties are access ed by placing the property name (e.g., Text) after the class<br />

name (e.g., lblWelcome), separated by the dot opera<strong>to</strong>r.<br />

TERMINOLOGY<br />

&= (string concatenation assignment opera<strong>to</strong>r) declaration<br />

*= (multiplication assignment opera<strong>to</strong>r) default property<br />

+= (addition assignment opera<strong>to</strong>r) definite repetition<br />

/= (division assignment opera<strong>to</strong>r) diamond symbol<br />

= (assignment opera<strong>to</strong>r) division by zero<br />

-= (subtraction assignment opera<strong>to</strong>r) Do While/Loop repetition structure<br />

\= (Integer division assignment opera<strong>to</strong>r) Do Until/Loop repetition structure<br />

^= (exponentiation assignment opera<strong>to</strong>r) Double primitive data type<br />

action symbol double-selection structure<br />

action/decision model of programming Else keyword<br />

algorithm ElseIf keyword<br />

attribute end of data entry<br />

behavior entry point of control structure<br />

body of a While exit point of control structure<br />

building block expanded code<br />

collapsed code first refinement<br />

complete representation of a program flag value<br />

conditional expression floating-point division<br />

connec<strong>to</strong>r symbol floating-point number<br />

constant flow of control<br />

control structure flowchart<br />

control-structure nesting flowline<br />

control-structure stacking fractional result<br />

counter GoTo elimination<br />

counter-controlled repetition “GoTo-less programming”<br />

decision symbol graphical representation of an algorithm

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!