Programming Lecture #2 CS 101 Autumn 2007 Tariq Jadoon
In Lecture #1 VB Integrated Development Environment (IDE) –Form Design Window –Project Window –Toolbox –Properties Window –Form Layout Window
Design Mode/ Run Mode Form Load, Click, dblClick Events –AutoRedraw –DrawWidth –Width –Height –Twips
–PSET (x,y), color –LINE (x1,y1)-(x2,y2), color –LINE (x1,y1)-(x2,y2), color, B –LINE (x1,y1)-(x2,y2), color, BF –CIRCLE (x,y), radius, color –CIRCLE (x,y), radius, color, start, end –CIRCLE (x,y), radius, color,,, aspect-ratio –RND ~ (0,1) –QBCOLOR (n) –CLS
Variables & Assignment Statements A variable is a named storage space –Naming variables follows certain simple rules: Assignment statements assign values to variables: Variable = Expression An assignment statement is NOT an equation
1 4 Variables & Assignment Statements X = 1 X = 4 Y = X XY 4
Processor Variables & Assignment Statements 4 X = 1 X = 4 Y = X X = Y + 2 XY =6 6
New Controls Introduced Label –Caption, top and left property CommandButton –Caption property and click event TextBox –Text property We also talked about the Print Method, as well as the forecolor and backcolor properties of forms