170 likes | 321 Views
CSI 101 Elements of Computing. Spring 2009 Lecture #12 – Using Visual Basic Developer Studio Monday, March 23 rd. Visual Studio. Development environment for Visual Basic Makes creation of VB applications easier Provides toolbars to assist developer Packages application in desired form
E N D
CSI 101Elements of Computing Spring 2009 Lecture #12 – Using Visual Basic Developer Studio Monday, March 23rd
Visual Studio • Development environment for Visual Basic • Makes creation of VB applications easier • Provides toolbars to assist developer • Packages application in desired form • Executable • DLL
Development Area • Workarea • Can see forms, code, and available toolbars • Project Window • Shows all forms in Project/Application • Properties Window • Shows properties of current object • Current object is the one highlighted in the workarea
Project Window Properties Window
Menu Bar • File: saving the Project’s data • Edit • View : change open Windows • Project : Add items to Project • Build : Compile your Project • Debug : Test your application • Ignore the others for now
Adding objects to Form • Click on icon in toolbox • Click on one corner where you want it • Holding down mouse button, roll mouse to ending point • Object will automatically be added • It becomes current object, with Properties window updating
Form Properties • (Name) : Name of form as seen in Project window • Back Color : background color • Caption : Title as appears on Title bar • Icon : Picture that appears on Windows application bar
Text Box Properties • (Name) : Name of object as referenced in code • Alignment : Text aligns with what? • Left – begins to left of box • Right – stops at right edge • Center – Centered in box • Font : Font style • Fore Color : Font color
Text Box Properties, cont • Locked : Can user change value in box? • Visible : Seen on screen • This property can be changed in procedure code • Often changed to “suddenly” make a text box apper
Command Button Properties • (Name) • Caption : Text that appears on button • Enabled : Button can be clicked • Often changed to make a button available only with certain text values
Object Event Code • Open Code window by double clicking on an object in the Work area • If no code previously, will create event procedure for most common event • Form_Load • CommandButton_Click • TextBox_Change
Common Events • Command Button • Click : Occurs when button is “clicked” • Text Box • Change : Value is changed or added • GotFocus : cursor arrives in text box • LostFocus : cursor leaves text box