SlideShare a Scribd company logo
1 of 33
Microsoft Visual Basic 2005
BASICS

     Lesson 2
     Forms, Controls, and
     Properties

          Microsoft Visual Basic 2005 BASICS
Objectives

    Create a new Visual Studio 2005 project.
    Save a Visual Studio 2005 project.
    View and modify form properties.
    Create controls, such as command
     buttons.




Microsoft Visual Basic 2005 BASICS      2
Objectives (cont.)

    Move, resize, and delete objects.
    Explain the concept of focus.
    Set additional properties (BackColor, Top,
     and Left).




Microsoft Visual Basic 2005 BASICS       3
Creating a New Project

    Create a new project
         Select the New Project option
             From the File menu
         Or push the New Project button
             On the Start Page




Microsoft Visual Basic 2005 BASICS         4
Creating a New Project (cont.)




Microsoft Visual Basic 2005 BASICS   5
Creating a New Project (cont.)




Microsoft Visual Basic 2005 BASICS   6
Forms

    Forms are the windows and dialog boxes
     when the program runs.
    Every program must have at least one
     form.
         All other objects must be contained within
          forms.




Microsoft Visual Basic 2005 BASICS             7
Forms (cont.)




Microsoft Visual Basic 2005 BASICS   8
Forms (cont.)




Microsoft Visual Basic 2005 BASICS   9
Saving the Project

    Visual Basic will save your project
     whenever you compile the program.
    Use the Save All button
         To save your project manually




Microsoft Visual Basic 2005 BASICS         10
Viewing and Modifying
Properties

    The Properties window
         Allows you to easily alter the properties of
          objects
    Important properties of a form
         The Text property specifies the text that
          appears in the title bar.
         The Name property names the object for
          coding.

Microsoft Visual Basic 2005 BASICS               11
Viewing and Modifying
Properties (cont.)




Microsoft Visual Basic 2005 BASICS   12
Viewing and Modifying
Properties (cont.)

    Naming objects
         Use names that are meaningful and that
          describe the object you are naming.




Microsoft Visual Basic 2005 BASICS           13
Viewing and Modifying
Properties (cont.)




Microsoft Visual Basic 2005 BASICS   14
Creating Controls

    Controls are the objects that make up the
     user interface.
    One of the most common controls is the
     command button.
    To create controls, you must access the
     Toolbox.




Microsoft Visual Basic 2005 BASICS      15
Creating Controls (cont.)




Microsoft Visual Basic 2005 BASICS   16
Creating Controls (cont.)




Microsoft Visual Basic 2005 BASICS   17
Setting Properties of the
Command Buttons

    Command buttons
         Have many properties that can be set
             Text property
                 Specifies the text that the user sees on the
                  command button
             Name property




Microsoft Visual Basic 2005 BASICS                      18
Moving, Resizing, and
Deleting Objects
   Objects can be moved and resized.
        Using techniques common to most
         Windows programs
   Delete an object
        Select the object and press the Delete key.
   Snap lines
        Colored lines
        Help you line objects up with one another

Microsoft Visual Basic 2005 BASICS            19
Moving, Resizing, and
Deleting Objects (cont.)




Microsoft Visual Basic 2005 BASICS   20
Moving, Resizing, and
Deleting Objects (cont.)




Microsoft Visual Basic 2005 BASICS   21
Understanding Focus

    The object that is currently active on the
     screen is said to have the focus.
    Press the Tab key
         To move the focus from one control to
          another
    Each object in a window will get the focus
     in a sequence.
         Called the tab order

Microsoft Visual Basic 2005 BASICS            22
Setting Additional Properties

    Other properties commonly set when
     creating Visual Basic programs
         BackColor
         Position and size of objects




Microsoft Visual Basic 2005 BASICS       23
Setting the BackColor
Property

    By default, forms have a gray
     background.
    Use BackColor property
         To change form background color
    Collections of colors
         System colors
         Web colors
         Custom colors

Microsoft Visual Basic 2005 BASICS          24
Setting the BackColor
Property (cont.)




Microsoft Visual Basic 2005 BASICS   25
Setting the Top and Left
Properties
   Use Location property
       For precise placements of objects
   Location property
       Point with X and Y values
       Locates the object at a distance from the
        upper-left corner of a form
       By default, the unit of measure is pixels.
            Smallest dot on a screen that the computer
             can address
Microsoft Visual Basic 2005 BASICS               26
Summary
   To create your own Visual Basic program,
    you must create a new project. The
    Windows Application project template
    allows you to create a program from
    scratch.
   Projects created using the Windows
    Application template begin with one blank
    form. Forms become the windows and
    dialog boxes when the program runs.
Microsoft Visual Basic 2005 BASICS     27
Summary (cont.)

    Every program has at least one form. All
     other objects must be contained within
     forms.
    Visual Studio 2005 will save your project
     whenever you compile the program.




Microsoft Visual Basic 2005 BASICS       28
Summary (cont.)

    A window created from a Visual Basic
     form has certain functionality by default,
     such as the ability to be moved, resized,
     maximized, minimized, and closed.
    Properties are the characteristics of
     Visual Basic objects. Properties can be
     modified in the Properties window.


Microsoft Visual Basic 2005 BASICS        29
Summary (cont.)

    The Text and (Name) properties are two
     of the most important properties. The
     Text property controls what the user sees
     in the title bar of a form and in other
     objects, such as command buttons.




Microsoft Visual Basic 2005 BASICS      30
Summary (cont.)

    When we add programming code later,
     the (Name) property allows us to refer to
     the object using a meaningful name.
     Programmers often use a naming
     standard when naming objects.
    Controls are the command buttons, text
     boxes, scroll bars, and other objects that
     make up the user interface.

Microsoft Visual Basic 2005 BASICS        31
Summary (cont.)

    A command button is a standard push-
     button control that commonly appears in
     dialog boxes. Command buttons can be
     moved, resized, and deleted like other
     Windows objects.
    Focus refers to the active status of one of
     the objects in a window. Only one object
     can have the focus.

Microsoft Visual Basic 2005 BASICS        32
Summary (cont.)

    The BackColor property controls the
     background color of a form.
    The Location property can be used to
     accurately position objects. By default,
     the X and Y point values of the Location
     property use a measurement called
     pixels.


Microsoft Visual Basic 2005 BASICS       33

More Related Content

Viewers also liked (17)

Les 02 1
Les 02 1Les 02 1
Les 02 1
 
NexGen Biosolutions Presentation
NexGen Biosolutions PresentationNexGen Biosolutions Presentation
NexGen Biosolutions Presentation
 
Samenwerkingsproject De Limissie (Linked In)
Samenwerkingsproject De Limissie (Linked In)Samenwerkingsproject De Limissie (Linked In)
Samenwerkingsproject De Limissie (Linked In)
 
Ppt lesson 09
Ppt lesson 09Ppt lesson 09
Ppt lesson 09
 
NexGen Biosolutions Presentation
NexGen Biosolutions PresentationNexGen Biosolutions Presentation
NexGen Biosolutions Presentation
 
PowerPoint Lesson 1
PowerPoint Lesson 1PowerPoint Lesson 1
PowerPoint Lesson 1
 
Project management
Project managementProject management
Project management
 
Ppt lesson 11
Ppt lesson 11Ppt lesson 11
Ppt lesson 11
 
Energy management
Energy managementEnergy management
Energy management
 
Pr & markedsføring
Pr  & markedsføringPr  & markedsføring
Pr & markedsføring
 
Post graduate diploma course in business administration
Post graduate diploma course in business administrationPost graduate diploma course in business administration
Post graduate diploma course in business administration
 
Ppt lesson 05
Ppt lesson 05Ppt lesson 05
Ppt lesson 05
 
Ppt lesson 10
Ppt lesson 10Ppt lesson 10
Ppt lesson 10
 
Ppt lesson 06
Ppt lesson 06Ppt lesson 06
Ppt lesson 06
 
Ppt lesson 01
Ppt lesson 01Ppt lesson 01
Ppt lesson 01
 
Ppt lesson 12
Ppt lesson 12Ppt lesson 12
Ppt lesson 12
 
Mitosis Flip Book By Alix Campbell
Mitosis Flip Book By Alix CampbellMitosis Flip Book By Alix Campbell
Mitosis Flip Book By Alix Campbell
 

Similar to PowerPoint Lesson 2

Visual programming basic.ppt bs cs5th class
Visual programming basic.ppt bs cs5th classVisual programming basic.ppt bs cs5th class
Visual programming basic.ppt bs cs5th class
mnewg218
 
Csc153 chapter 03
Csc153 chapter 03Csc153 chapter 03
Csc153 chapter 03
PCC
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
EliasPetros
 
Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)
Mark Vincent Cantero
 

Similar to PowerPoint Lesson 2 (20)

VB6_INTRODUCTION.ppt
VB6_INTRODUCTION.pptVB6_INTRODUCTION.ppt
VB6_INTRODUCTION.ppt
 
Vb 6ch123
Vb 6ch123Vb 6ch123
Vb 6ch123
 
visual basic for the beginner
visual basic for the beginnervisual basic for the beginner
visual basic for the beginner
 
Visual Studio 2012 Course Blackboard TIC
Visual Studio 2012 Course Blackboard TICVisual Studio 2012 Course Blackboard TIC
Visual Studio 2012 Course Blackboard TIC
 
Visual programming basic.ppt bs cs5th class
Visual programming basic.ppt bs cs5th classVisual programming basic.ppt bs cs5th class
Visual programming basic.ppt bs cs5th class
 
Login Project with introduction .pptx
Login Project with introduction .pptxLogin Project with introduction .pptx
Login Project with introduction .pptx
 
Vb lecture
Vb lectureVb lecture
Vb lecture
 
Vb basics
Vb basicsVb basics
Vb basics
 
Csc153 chapter 03
Csc153 chapter 03Csc153 chapter 03
Csc153 chapter 03
 
Book HH- vb2008me preview
Book   HH- vb2008me previewBook   HH- vb2008me preview
Book HH- vb2008me preview
 
Programming basics
Programming basicsProgramming basics
Programming basics
 
Csphtp1 02
Csphtp1 02Csphtp1 02
Csphtp1 02
 
Chapter2.ppt
Chapter2.pptChapter2.ppt
Chapter2.ppt
 
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptxhjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
hjksjdhksjhcksjhckjhskdjhcskjhckjdppt.pptx
 
Chapter 1
Chapter 1Chapter 1
Chapter 1
 
Visual C# 2010
Visual C# 2010Visual C# 2010
Visual C# 2010
 
Visual basic
Visual basicVisual basic
Visual basic
 
Visual Basic.pptx
Visual Basic.pptxVisual Basic.pptx
Visual Basic.pptx
 
Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)Introduction to visual basic 6 (1)
Introduction to visual basic 6 (1)
 
Technology and Livelihood Education IV
Technology and Livelihood Education IVTechnology and Livelihood Education IV
Technology and Livelihood Education IV
 

More from Linda Bodrie

More from Linda Bodrie (7)

Ppt lesson 08
Ppt lesson 08Ppt lesson 08
Ppt lesson 08
 
Ppt lesson 07
Ppt lesson 07Ppt lesson 07
Ppt lesson 07
 
Ppt lesson 06
Ppt lesson 06Ppt lesson 06
Ppt lesson 06
 
Ppt lesson 06
Ppt lesson 06Ppt lesson 06
Ppt lesson 06
 
Lesson 5 PP
Lesson 5 PPLesson 5 PP
Lesson 5 PP
 
Lesson 4 PowerPoint
Lesson 4 PowerPointLesson 4 PowerPoint
Lesson 4 PowerPoint
 
Ppt lesson 03
Ppt lesson 03Ppt lesson 03
Ppt lesson 03
 

PowerPoint Lesson 2

  • 1. Microsoft Visual Basic 2005 BASICS Lesson 2 Forms, Controls, and Properties Microsoft Visual Basic 2005 BASICS
  • 2. Objectives  Create a new Visual Studio 2005 project.  Save a Visual Studio 2005 project.  View and modify form properties.  Create controls, such as command buttons. Microsoft Visual Basic 2005 BASICS 2
  • 3. Objectives (cont.)  Move, resize, and delete objects.  Explain the concept of focus.  Set additional properties (BackColor, Top, and Left). Microsoft Visual Basic 2005 BASICS 3
  • 4. Creating a New Project  Create a new project  Select the New Project option  From the File menu  Or push the New Project button  On the Start Page Microsoft Visual Basic 2005 BASICS 4
  • 5. Creating a New Project (cont.) Microsoft Visual Basic 2005 BASICS 5
  • 6. Creating a New Project (cont.) Microsoft Visual Basic 2005 BASICS 6
  • 7. Forms  Forms are the windows and dialog boxes when the program runs.  Every program must have at least one form.  All other objects must be contained within forms. Microsoft Visual Basic 2005 BASICS 7
  • 8. Forms (cont.) Microsoft Visual Basic 2005 BASICS 8
  • 9. Forms (cont.) Microsoft Visual Basic 2005 BASICS 9
  • 10. Saving the Project  Visual Basic will save your project whenever you compile the program.  Use the Save All button  To save your project manually Microsoft Visual Basic 2005 BASICS 10
  • 11. Viewing and Modifying Properties  The Properties window  Allows you to easily alter the properties of objects  Important properties of a form  The Text property specifies the text that appears in the title bar.  The Name property names the object for coding. Microsoft Visual Basic 2005 BASICS 11
  • 12. Viewing and Modifying Properties (cont.) Microsoft Visual Basic 2005 BASICS 12
  • 13. Viewing and Modifying Properties (cont.)  Naming objects  Use names that are meaningful and that describe the object you are naming. Microsoft Visual Basic 2005 BASICS 13
  • 14. Viewing and Modifying Properties (cont.) Microsoft Visual Basic 2005 BASICS 14
  • 15. Creating Controls  Controls are the objects that make up the user interface.  One of the most common controls is the command button.  To create controls, you must access the Toolbox. Microsoft Visual Basic 2005 BASICS 15
  • 16. Creating Controls (cont.) Microsoft Visual Basic 2005 BASICS 16
  • 17. Creating Controls (cont.) Microsoft Visual Basic 2005 BASICS 17
  • 18. Setting Properties of the Command Buttons  Command buttons  Have many properties that can be set  Text property  Specifies the text that the user sees on the command button  Name property Microsoft Visual Basic 2005 BASICS 18
  • 19. Moving, Resizing, and Deleting Objects  Objects can be moved and resized.  Using techniques common to most Windows programs  Delete an object  Select the object and press the Delete key.  Snap lines  Colored lines  Help you line objects up with one another Microsoft Visual Basic 2005 BASICS 19
  • 20. Moving, Resizing, and Deleting Objects (cont.) Microsoft Visual Basic 2005 BASICS 20
  • 21. Moving, Resizing, and Deleting Objects (cont.) Microsoft Visual Basic 2005 BASICS 21
  • 22. Understanding Focus  The object that is currently active on the screen is said to have the focus.  Press the Tab key  To move the focus from one control to another  Each object in a window will get the focus in a sequence.  Called the tab order Microsoft Visual Basic 2005 BASICS 22
  • 23. Setting Additional Properties  Other properties commonly set when creating Visual Basic programs  BackColor  Position and size of objects Microsoft Visual Basic 2005 BASICS 23
  • 24. Setting the BackColor Property  By default, forms have a gray background.  Use BackColor property  To change form background color  Collections of colors  System colors  Web colors  Custom colors Microsoft Visual Basic 2005 BASICS 24
  • 25. Setting the BackColor Property (cont.) Microsoft Visual Basic 2005 BASICS 25
  • 26. Setting the Top and Left Properties  Use Location property  For precise placements of objects  Location property  Point with X and Y values  Locates the object at a distance from the upper-left corner of a form  By default, the unit of measure is pixels.  Smallest dot on a screen that the computer can address Microsoft Visual Basic 2005 BASICS 26
  • 27. Summary  To create your own Visual Basic program, you must create a new project. The Windows Application project template allows you to create a program from scratch.  Projects created using the Windows Application template begin with one blank form. Forms become the windows and dialog boxes when the program runs. Microsoft Visual Basic 2005 BASICS 27
  • 28. Summary (cont.)  Every program has at least one form. All other objects must be contained within forms.  Visual Studio 2005 will save your project whenever you compile the program. Microsoft Visual Basic 2005 BASICS 28
  • 29. Summary (cont.)  A window created from a Visual Basic form has certain functionality by default, such as the ability to be moved, resized, maximized, minimized, and closed.  Properties are the characteristics of Visual Basic objects. Properties can be modified in the Properties window. Microsoft Visual Basic 2005 BASICS 29
  • 30. Summary (cont.)  The Text and (Name) properties are two of the most important properties. The Text property controls what the user sees in the title bar of a form and in other objects, such as command buttons. Microsoft Visual Basic 2005 BASICS 30
  • 31. Summary (cont.)  When we add programming code later, the (Name) property allows us to refer to the object using a meaningful name. Programmers often use a naming standard when naming objects.  Controls are the command buttons, text boxes, scroll bars, and other objects that make up the user interface. Microsoft Visual Basic 2005 BASICS 31
  • 32. Summary (cont.)  A command button is a standard push- button control that commonly appears in dialog boxes. Command buttons can be moved, resized, and deleted like other Windows objects.  Focus refers to the active status of one of the objects in a window. Only one object can have the focus. Microsoft Visual Basic 2005 BASICS 32
  • 33. Summary (cont.)  The BackColor property controls the background color of a form.  The Location property can be used to accurately position objects. By default, the X and Y point values of the Location property use a measurement called pixels. Microsoft Visual Basic 2005 BASICS 33

Editor's Notes