INFS630INFS639 - PowerPoint PPT Presentation

1 / 12
About This Presentation
Title:

INFS630INFS639

Description:

Programmer builds ... The programmer adds controls (labels, textboxes, option buttons, ... not disappear until the programmer wants it to. UserFormname.Show ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 13
Provided by: uccs
Category:

less

Transcript and Presenter's Notes

Title: INFS630INFS639


1
INFS630/INFS639
  • Chapter 7
  • Fall 2004

2
Overview
  • Userforms
  • Frames
  • Listboxes and ComboBoxes
  • Review BlackJack Project

3
Userforms
  • Userforms are used to add GUI-Type interfaces to
    the spreadsheets
  • Programmer builds custom dialog boxes
  • The Form is an object (therefore it has methods
    and properties)
  • Add from VBA IDE (design mode)
  • gt Insert gt Userform

4
UserForm
Insert Userform here
Userform is stored here by its .Name Property
5
UserForm Objects
  • The programmer adds controls (labels, textboxes,
    option buttons, check boxes, etc.)
  • The Form is an object and therefore has methods
    and properties
  • .Show method - shows the forms to the user
  • Load command puts form in memory and the shows
    it
  • .Hide method hides the form from the user
  • Unload command hides the form from the user and
    takes form out of memory
  • Modal vs Modeless

6
Modal vs Modeless
  • Modal the form is displayed to the user and the
    user MUST respond to form. The form does not
    disappear until the programmer wants it to
  • UserFormname.Show Modal
  • Modeless the form is displayed to the user but
    the form can be manipulated by the user (e.g.
    hidden) and the code is still processed
  • A programmer can choose to display their form in
    Modal or Modeless format.

7
Frames
  • The Frame object can be used to divide the screen
    up into sections.
  • Main purpose is to organize Option Buttons. Why?
  • Use Frames to organize Option Buttons and Check
    Boxes
  • Frames have some properties and methods.

8
ListBoxes and ComboBoxes
  • Main difference is one (ComboBox) has a textbox
    field that allows user input
  • Similar Properties / Methods
  • .Name AddItem
  • .MultiSelect Clear
  • .ListCount .ListIndex
  • P. 245 shows how these work together

9
ListBoxes and ComboBoxes
  • Main difference is one (ComboBox) has a textbox
    field that allows user input
  • Similar Properties / Methods
  • .Name AddItem
  • .MultiSelect Clear
  • .ListCount .ListIndex
  • Operate like arrays
  • Need a subscript Subscripts start at 0
  • So, write a FOR NEXT loop to add the contents
    of A1..A10 into a listbox (lstMyList)
  • P. 245 shows how these work together

10
Loading a ListBox
11
The BlackJack Project
  • On pages 246 266, the book goes through a
    detailed program, you should be able to
    understand them Here are a few
  • Look at the arrays and how they are indexed
  • Nested Loops p 265
  • For Each loop p 263
  • Using the Range command p 263
  • Case Statement p 261
  • Additems for a listbox p 254
  • The explicit reference used in the Format
    statement p 238

12
Summary
  • Userforms are used to communicate with the users.
  • Frames can be used to segment the userform
    wherebt multiple sets of option buttons can be
    used by the programmer
  • Listboxes and Comboboxes can be used to present
    lists of choices to the user
Write a Comment
User Comments (0)
About PowerShow.com