Ch09 - 1 Chapter 9 Additional Controls and Objects 9.1 List...

Info iconThis preview shows pages 1–18. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 1 Chapter 9 Additional Controls and Objects 9.1 List Boxes and Combo Boxes 9.2 Eight Additional Controls and Objects 9.3 Multiple-Form Objects 9.4 Graphics 2 9.1 List Boxes and Combo Boxes A Review of List Box Features Some Additional Features of List Boxes The Combo Box Control A Helpful Feature of Combo Boxes Fill a List Box at Design Time via its String Collection Editor 3 tasks button click here to invoke string collection editor String Collection Editor 4 Fill by direct typing or by copying and pasting from a text editor or a spreadsheet. List Box at Run Time 5 lstMonths selected item The value of lstMonths.Text is the string consisting of the selected item. Indexes The items in a list box are indexed with zero-based numbering. lstBox.Items(0) lstBox.Items(1) . . 6 List Box Properties 7 lstBox.Text: The selected item as a string. lstBox.Items.Count: The number of items in the list box. lstBox.Sorted: If set to True, items will be displayed in ascending ANSI order. lstBox.SelectedIndex: The index of the selected item. If no item is selected, the value is -1. More List Box Properties lstBox.Items(n ): The item having index n . It must be converted to a string before being displayed in a text or message box. lstBox.DataSource: The source of data to populate the list box. 8 List Box Events lstBox.SelectedIndexChanged: Raised when the value of the SelectedIndex property changes. (default event procedure) lstBox.Click: Raised when the user clicks on the list box. lstBox.DoubleClick: Raised when the user double-clicks on the list box. 9 List Box Methods lstBox.Items.IndexOf( value ): Index of the first item to have the value. lstBox.Items.RemoveAt( n ): Delete item having index n . lstBox.Items.Remove( strValue ): Delete first occurrence of the string value. lstBox.Items.Insert( n , value ): Insert the value as the item of index n . 10 11 The Combo Box Control A list box combined with a text box The user has the option of filling the text box by selecting from a list or typing directly into the list box. Essentially same properties, events, and methods as a list box DropDownStyle property specifies one of three styles Combo Box Styles 12 Styles at Run Time after Arrows are Clicked 13 The value of cboBox.Text is the contents of the text box at the top of the combo box. 14 Example 3 Private Sub btnDisplay_Click( ... ) _ Handles btnDisplay.Click txtDisplay.Text = cboTitle.Text & " " & txtName.Text End Sub cboTitle txtDisplay txtName cboTitle Helpful Feature of Combo Box 15 16 9.2 Eight Additional Controls and Objects The Timer Control The Random Class The ToolTip Control The Clipboard Object The Picture Box Control The MenuStrip Control The Horizontal and Vertical Scroll Bar Controls 17 The Timer Control Invisible during run time Raises an event after a specified period of time The Interval property specifies the time period...
View Full Document

This note was uploaded on 01/19/2012 for the course CIT 230 taught by Professor Staff during the Fall '08 term at Oakland University.

Page1 / 82

Ch09 - 1 Chapter 9 Additional Controls and Objects 9.1 List...

This preview shows document pages 1 - 18. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online