Forms and Objects - PowerPoint PPT Presentation

1 / 7
About This Presentation
Title:

Forms and Objects

Description:

... Box. List Box. Buttons. Option button. Image box ... Then clear the input data from each box. In cmdQuit_Click make sure you quit the form (frmStudent.Hide) ... – PowerPoint PPT presentation

Number of Views:12
Avg rating:3.0/5.0
Slides: 8
Provided by: pete7
Category:
Tags: box | forms | hide | my | objects

less

Transcript and Presenter's Notes

Title: Forms and Objects


1
Forms and Objects
  • Advanced GISWeek 2
  • 2006 Fall

2
Difference between Msgbox and forms
  • MsgBox and Inputbox can only have limited
    functions. Asking users to type in values, names,
    strings, and received by an variable.
  • Form contain many buttons (called controls),
    such as
  • Labels
  • Textbox
  • Combo Box
  • List Box
  • Buttons
  • Option button
  • Image box

3
Control Naming convention
  • The following table shows common prefixes and
    name examples for some common controls.
  • Object  Prefix  Example
  • Form frm frmSelect
  • Label lbl lblSearchString
  • Combo boxcbo cboEditFeature
  • Command button cmd cmdCancel
  • Directory listbox dir dirPath
  • Drive listbox drv drvDrive
  • Image img imgBitmap
  • Listbox lst lstSelectedFile
  • Menu mnu mnuFileSaveAs
  • Option button opt optTopology
  • Timer tmr tmrAlarm
  • Common dialog dlg dlgSaveAs

4
Form name and controls
  • Change name from UserForm1 to frmStudent
    (convention for form is frm)
  • Change caption to Student Data
  • Add the following controls to the frmStudent
  • txtName, lblName
  • txtCity, lblCity
  • cboState, lblState
  • cmdClear, cmdQuit, cmdShowData

5
Create a button to show form
  • Create a new toolbar and name it as Week 2
    saved in untitled if your project is not saved
    yet.
  • Create a new UIButtonControl and name it as
    Project.ShowForm
  • Drag it to the Week 2
  • Code this button to show frmStudent
  • Private Sub ShowForm_Click()
  • frmStudent.Show
  • End Sub

6
Write code to controls
  • Write code to addItem to cboState while in
    frmStudent.initialize
  • Tennessee,Kentucky,Georgia, North
    Carolina, India, Other
  • In cmdClear_click make sure the frmStudent is
    dismissed (txtName.Text )
  • In cmdShowData_Click make sure you show users
    typed data using a new lblShowData (type in the
    following codes
  • lblShowData.Caption txtName.Text is from

7
Code
  • Then clear the input data from each box.
  • In cmdQuit_Click make sure you quit the form
    (frmStudent.Hide)
  • Use two optionbuttons to show favorite sports
  • Use Image control to add image from
    g\5850\castle.jpg
  • Add necessary labels to show the functions of
    controls
Write a Comment
User Comments (0)
About PowerShow.com