Presentation is loading. Please wait.

Presentation is loading. Please wait.

Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.

Similar presentations


Presentation on theme: "Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San."— Presentation transcript:

1 Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San Diego

2 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Ch. 2: More Controls  Introducing more controls  Working with multiple controls  Designing your applications for user convenience  Coding for the controls  Programming hints

3 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Introducing More Controls  Labels: lblName.Caption=txtName.Text  Text boxes: txtName.Text=“French”  Frames: Groups option buttons  Check boxes: chkName.Value=0, 1 or 2.caption is name  Option buttons: optButton.value=True or False  Images

4 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Tools Introduced in Chapter 2 Check box Frame Shape Image Option button Text box Line

5 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Text Boxes  Default property is.Text –txtLastName = “Frockmeister” sets.Text prop.  Alignment property –0 (left) –1 (right) –2 (center)  The Multiline property must be true, otherwise the alignment is ignored.

6 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Frames  Frames are containers for option buttons and check boxes  Frames establish the mutually exclusive nature of buttons: Frame Option buttons

7 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Check Boxes  Select or deselect Yes/No options  Default property is.Value  Example: chkPrint.Value = 0 (no)  0 = no, 1 = yes (checked), 2=disabled check box

8 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Option Buttons  Used for mutually exclusive choices such as color choices or Print All, Print Selection, or Print One Page  Default property is.Value (0 or 1)  Names: optBlue, optFontSize Option buttons

9 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Images  An image holds a picture (not an OLE object)  Properties: –.Picture (the file name of an image to display) –.Stretch (picture fills control) –.Visible (true/false makes it appear/disappear)  Example: imgFlag.Visible = False

10 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Shape Control  Shape control places rectangles, squares, ovals, circles, or other shapes on a form  Shape is determined by.Shape property Shape property value

11 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Line Control  Draw lines on a form to separate elements  Name example: linLogo  A Line has very few properties: –BorderStyle –BorderWidth –BorderColor

12 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Working with Multiple Controls  Selecting multiple controls  Deselecting a group of controls  Moving controls as a group  Setting properties for multiple controls  Aligning controls

13 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Designing Your Applications for User Convenience  Designing the user interface  Defining keyboard access keys (Exit)  Setting command button Default and Cancel properties.Default = True or False.Cancel = True or False  Setting the tab order property of controls –TabStop property (.Enabled = yes) –TabIndex property (a value beginning at 0)

14 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Coding for the controls  Clearing text boxes and labels  Resetting the focus  Setting option buttons/check boxes value properties  Changing the font  Properties of controls  Changing multiple properties of a control  Continuing program lines

15 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Controls' Default Properties  Each control has a default property  A default property is the implied property for the object if you omit it following the object: –txtAddress = "1234 Somewhere Street" –chkPrint = True –lstChoice(index) = "14"

16 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Programming hints  Check the tab order of an application  Use the value property of a check box or option button to set other true/false properties.  Ctrl-click a tool to repeatedly use tool  Create an option button inside its frame  Label controls are “read only” messages  Text controls are input/output controls

17 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Review Questions - 1 of 2  See the "notes" portion of this slide to see the review questions

18 Copyright© 2000 by the McGraw-Hill Companies, Inc.Irwin/McGraw-Hill Review Questions - 2 of 2  See the "notes" portion of this slide to see the review questions -END OF CHAPTER-


Download ppt "Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San."

Similar presentations


Ads by Google