Visual Basic Development Environment - PowerPoint PPT Presentation

1 / 20
About This Presentation
Title:

Visual Basic Development Environment

Description:

Get to know VB's integrated development environment (IDE) Learn a little VB ... http://web.bvu.edu/faculty/shepherd/im/borat.gif. Add a PictureBox to the form ... – PowerPoint PPT presentation

Number of Views:226
Avg rating:3.0/5.0
Slides: 21
Provided by: web9
Category:

less

Transcript and Presenter's Notes

Title: Visual Basic Development Environment


1
Visual Basic Development Environment
  • CMSC-160 Programming in Visual Basic
  • Fall 2007
  • Jason B. Shepherd

2
In this presentation
  • Get to know VBs integrated development
    environment (IDE)
  • Learn a little VB
  • Learn how to build and run programs/applications

3
Where is VB on my laptop?
  • Start menu
  • All Programs
  • Applications
  • Microsoft Visual Basic 2005 Express Edition

4
Visual Basic Start Page
5
Start a New Project
6
New Project Dialog Box
7
Initial Visual Basic Screen
8
Dude, wheres my ____?
  • If your toolbox, Solution Explorer, etc., somehow
    disappears (e.g., you accidentally close your
    toolbox), bring it back by finding it in the
    View menu.

9
Toolbox
10
Remember Program Development Cycle?
  • Analyze whats the problem
  • Design whats the solution (plain English
    algorithm)
  • Choose the interface which controls
  • Code algorithm ? code
  • Test and Debug errors?
  • Document

11
Our first application Hello, World!
  • The problem
  • Show a window that says Hello, World!
  • The solution
  • Display a label in the center of a form
  • Set the labels text to Hello, World!
  • (Actually no coding involved!)
  • Lets code, build, and run it!

12
Our first application Hello, World!
  • Create a new project (as shown previously)
  • Drag Label from the Toolbox onto Form1 in the
    form designer
  • This creates a control called Label1
  • Make sure Label1 is selected
  • In Properties, change the Text property from
    Label1 to Hello, World! and press Enter
  • In Properties, change the Font property so that
    the text size is 26 point
  • In the form designer, reposition Label1 so that
    it is centered
  • File ? Save All
  • Enter Hello World as the projects name
  • Click the Run button (looks like a Play icon
    on a DVD player green triangle pointing to the
    right)

13
Hello, World Kazakhi-style!
  • Download this image to your desktop
  • http//web.bvu.edu/faculty/shepherd/im/borat.gif
  • Add a PictureBox to the form
  • Click on the Tasks button on the PictureBox to
    display a drop down menu
  • Click Choose Image on the Tasks drop down menu
    and choose the image you downloaded to your
    desktop
  • Using the Tasks drop down menu again, choose
    AutoSize for Size Mode
  • Resize the image and the form so it all fits
    nicely
  • Change Label1 to read Jagshemash!
  • Run it!

14
Lets digress
  • Naming controls
  • How programmer refers to controls in code
  • Set the Name property in the Properties dialog
  • Name must begin with a letter, be less than 215
    characters long, and may include numbers and
    letters
  • Use appropriate 3-letter naming prefix
  • Use camel case

15
Control Name Prefixes
16
Renaming a Form
  • Initial name is Form1
  • The Solution Explorer window lists a file named
    Form1.vb.
  • To rename the form, right click on the file name,
    choose rename, and change the name of this file
    to newName.vb
  • newName should begin with prefix frm.

17
Fonts
  • Proportional width fonts take up less space for
    "I" than for "W" like Microsoft Sans Serif
  • Fixed-width fonts take up the same amount of
    space for each character like Courier New
  • Fixed-width fonts are good for tables.
  • They make columns line up

18
Positioning Controls
Proximity line
19
Aligning Controls
Snap line
20
Aligning Controls
Snap line
Write a Comment
User Comments (0)
About PowerShow.com