1 / 10

Creating a Visual Basic Program

Creating a Visual Basic Program. Where to start…. 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.

Download Presentation

Creating a Visual Basic Program

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

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.

More Related