Creating a Visual Basic Program - PowerPoint PPT Presentation

creating a visual basic program n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Creating a Visual Basic Program PowerPoint Presentation
Download Presentation
Creating a Visual Basic Program

play fullscreen
1 / 10
Creating a Visual Basic Program
69 Views
Download Presentation
kerry-daniel
Download Presentation

Creating a Visual Basic Program

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript

  1. Creating a Visual Basic Program Where to start….

  2. These buttons toggle between the code and this form This holds the properties of each label, command and button This toolbox will help you create text boxes, labels, command buttons, check boxes and option boxes

  3. Step 1. Create the form how you wish Examples of each item often used to create forms From within the properties frame, change the name, caption, picture, visibility, font, border-style or value

  4. Step 2. Name each item and include an appropriate caption or picture if necessary. Each name must have the appropriate prefix, then finish the name using a capital letter so it is easier to see. Frames – fra Label – lbl Textbox – txt Form – frm Command – cmd Checkbox – chk Option – opt Image – img

  5. Naming conventions Label lblName Command buttons cmdCalculate Text box txtName Label with different Border Style lblMessage

  6. For the command, cmdExit, the caption E&xit will create a command button Exit so users can type Alt-X to exit. Set cmdExit Cancel to true Set cmdShow Default to true

  7. Step 3. Add code Clicking twice on each item will bring up the code screen. Then add the specific code. VB uses Object.Property=value to assign properties. In this case, it is lblShow.Caption= “The time is….”

  8. You must put comments (called remarks) into your program so you can understand it later, or so others can read it. Placing a ‘ tells the computer to ignore the line and allows you to place remarks.

  9. To save your program • Create a folder for each unit • Place the program in this folder with an appropriate name- frmExample is a good title, frm1 is not. • For tests, create a folder called NameTest1 and place the test within that folder

  10. When you are done, click on the to run the program All programs are finished when your program works, you have a fully labeled diagram in your binder and pseudo-code. Pseudo-code is a shorthand written version of your code. As you create the form, you also label a picture so you know what each item is called. Then you do the pseudo-code. ONLY THEN do you create your program code.