16. The IDE Initial Screen The Visual Studio IDE with the Start Page open, as it first appears in Windows XP, without an open project.
17. IDE Main Window Toolbars Document Window Form Designer Solution Explorer Window Properties Window Toolbox Help
18.
19.
20. Writing Your First Visual Basic Project Setting Up the Project 1 2 3 Hello World Project
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34. Recommended Naming Conventions for VB Objects introPageSoundPlayer SoundPlayer ingredientsListBox ListBox bookListComboBox ComboBox landscapePictureBox PictureBox temperatureVerticalScrollBar Vertical Scroll Bar rateHorizontalScrollBar Horizontal Scroll Bar printSummaryCheckBox CheckBox boldRadiobutton Radio button paymentAmountTextbox TextBox totalLabel Label exitButton Button dataEntryForm Form Example Object Class
35.
36.
Editor's Notes
Brief description on how to navigate within this presentation (ppt) The first time a Key Term from the chapter is used in the ppt it will display in blue Gold colored text boxes display coding examples Slides will be numbered (# of #) when multiple slides on same topic (Slide title) Speaker notes are included where appropriate for slides (*)Denotes either a comment for page reference to textbook or slide reference in ppt
Planning- Design the user interface—draw a sketch of the screens the user will see when running the project; include forms and all controls that are to be used including the names to be assigned Plan the properties—for each object write down the properties that you plan to set or change during the design of the form Plan the Basic code—plan the classes and procedures that will execute when the project runs including determining which events require action to be taken and then make a step-by-step plan for the actions Programming- Define the user interface-- create Forms and Controls Set the properties--give each object a name and define attributes such as the contents of a label, size, Write the Basic code—use Basic programming statements to carry out the actions needed by the program
Solution file-text file that holds information about the solution and the projects it contains; primary file Solution user options file-stores information about the selected options A.Vb file—holds the definition of a form, its controls, and code procedures Resource file—a text file that defines all resources used by the form including string of text, numbers and any graphics Project file—text file that describes the project and lists the files that are included in the project Project user option file—text file holds project option settings so that the next time a project is opened all selected options are restored
IDE tools Form designer-visually create a form Editor-entering and modifying program code Compiler-for translating the Visual Basic statements into the intermediate machine code Debugger-to help locate and correct program errors Object browser-to view the available classes, objects, properties, methods and events Help facility-to provide answers to questions
Toolbars—are shortcuts for frequently used operations; each button represents a command Document Window—largest window in the center of the screen; items that display in the Document window include: Form Designer, the Code Editor, the Object Browser, and the pages of Help that are requested Form Designer—where a form is designed that makes up the user interface Solution Explorer Window—holds the filenames for the files included in your project and a list of the classes it references Properties Window—used to set the properties for the objects in a project Toolbox—holds tolls that are used to place controls on a form Help—is expanded for >NET and includes the Microsoft Developer Network library containing reference materials for VB and other languages; as well as books, technical articles, Microsoft Knowledge Bases, and a database of FAQ’s.
The Title Bar indicates which mode is currently being used.
Step 1—set up the Workspace; run Visual Studio IDE and customize the workspace if desired Step 2—start a New Project Step 3—set up the environment—customize windows and toolbars
Design the user interface by making a sketch of the form that includes the controls Resize the form in the document window; drag the handle (key term) in the lower-right corner Place the controls by pointing to the tool in the toolbox and clicking to select; drag the pointer over the form and the pointer becomes a crosshair; point to a spot to place the corner of the control and drag to create the control; a selected control that is selected will have 8 small square handles around it (Button 2) Once the controls have been selected and placed on the form right-click on one of the controls and select Lock Controls from the context menu
Click on the control and then click in the properties window to select and change desired properties of the control and/or form
You write code in VB in procedures; currently each procedure will be a sub procedure (Key Term) and being with the words Private Sub and end with End Sub
Details for the Remark statement, assignment statement, ending a program and the editor window are shown on the following 4 slides
When double-clicking on a button the Visual Studio editor opens with the first and last one of your sub procedure already in place and the insertion point indented inside the sub procedure Declaration section – section at the top of the file
Run the project to determine if there are any errors (debugging) that need to be fixed. Save All saves the current form, project, and solution files to the path that was selected when you started the project. You cannot change the path after beginning a project. If wanting to move or rename the project it must be closed. Modify project is you want to change the controls or control properties such as font size, size of a label, etc.
Using good consistent names for objects can make a project easier to read and understand, as well as easier to debug. When you select a name for an object, Visual Basic requires the name to begin with a letter or an underscore; names can contain letters, digits, and underscores but no spaces, punctuation marks or reserved words such as Exit or It. Camel casing is beginning the name with a lowercase character and capitalize each additional word in the name.
MSDN-Microsoft Developer Network library A good way to start using Help is to view the topics that demonstrate how to look up topics in Help.
A quick way to view Help on any topic is to use context-sensitive Help (Key term)