Working with User Input - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Working with User Input

Description:

Selecting the class and method names from the listboxes at the top of the code window ... Click on the Add ToolStrip button to select tools to add from the pop up menu ... – PowerPoint PPT presentation

Number of Views:56
Avg rating:3.0/5.0
Slides: 11
Provided by: busi186
Category:

less

Transcript and Presenter's Notes

Title: Working with User Input


1
Working with User Input
  • Business 92
  • Spring 2008
  • Roldan

2
Event Procedures
  • Create event Procedures by
  • Double-clicking on the relevant control
  • Selecting the class and method names from the
    listboxes at the top of the code window
  • Type in the relevant code or use code-snippets to
    start

Method
Control/Class
3
Working with other types of events
  • The Form_Load event is a good event to associate
    with the baseline look of your form
  • Code anatomy
  • Button1.Enabled False
  • Label1.Hide()

4
Combining events data retrieval in one form
5
Retrieving Data from Controls
  • A new event Button1_MouseHover
  • See page 136 for a table of Controls store
    control information, the property that you use to
    access the information and the type of data
    stored
  • Conditional Statements like IfThen.Elseif.End
    help you use the informations to control how your
    application behaves
  • Code Anatomy
  • If CheckBox1.Checked And Not CheckBox2.Checked
    Then
  • Label1.Text TextBox1.Text
  • ElseIf CheckBox2.Checked Then
  • Label1.Text "Please click Here"
  • ElseIf CheckBox1.Checked And CheckBox2.Checked
    Then
  • Label1.Text "Please click Here"
  • End If
  • Label1.Show()

6
Nice to have
  • New event Button1_MouseLeave
  • Code Anatomy Label1.Hide()

No Label whenmouse is not hovering over Button 1
7
Complete Code
8
Pull-Down Menus
  • Use the Menustrip control in the Menus Toolbars
    category of the toolbar to add a menu to your
    application
  • Type menu items in the areas marked Type Here
  • Double-click on a menu item to associate code
    with it

9
Toolstrips
  • Use the ToolStrip control located in the Menus
    Toolbars category of the Toolbox
  • Click on the Add ToolStrip button to select tools
    to add from the pop up menu
  • Double-click on a toolstrip tool to associate
    code with it

10
In Class Work
  • Do the tutorials on pages 133, 136, 151 and 157
  • Add the following to your application
  • A pull down menu or toolstrip
  • Code for an event other than a button-click
  • A procedure that uses data retrieved from a
    control
  • Important! Build the executable for your
    application and tutorials and place them in a
    folder named feb21
Write a Comment
User Comments (0)
About PowerShow.com