Lab4 ListBox Control Properties, Methods and Events.

Slides:



Advertisements
Similar presentations
Lists, Loops, Validation, and More
Advertisements

Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 5- 1 STARTING OUT WITH Visual Basic 2008 FOURTH EDITION Tony Gaddis.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Working with Intrinsic Controls and ActiveX Controls
List box & Combo box controls School of Business Eastern Illinois University © Abdou Illia, Spring 2003 (Week 14, Monday 4/21/2003)
Creating Custom Reports. 2 Design and create a custom report You can easily create custom reports based on a table or query. There are seven sections.
1 Visual Basic Programming II Lecture 3 MIS233 Instructor – Larry Langellier.
Microsoft Visual C#.NET: From Problem Analysis to Program Design1 Chapter 9 Programming Based on Events Microsoft Visual C#.NET: From Problem Analysis.
C# Programming: From Problem Analysis to Program Design1 9 Programming Based on Events.
1 Lab6 Lab6 ComboBox Control Properties, Methods and Events.
Programming Based on Events
Using String Functions Left(str, nchars) - extract left nchars Right(str, nchars) - extract right nchars Mid(str,start,[nchars]) - get middle chars.
VB Default Controls List Box, Combo Box
ListBoxes The list box control allows the user to view and select from multiple items in a list. CheckedListBox control extends a list box by including.
Group Boxes and Panels Arrange components on a GUI Buttons and etc. can be placed inside a group box or panel. All these buttons move together when the.
CVEV 118/698 Visual Basic Lecture 3 Prof. Mounir Mabsout Elsa Sulukdjian Walid El Asmar.
Programming Based on Events
List-based Controls. Slide 2 Introduction There are several controls that work with lists ComboBox ListBox CheckedListBox.
Copyright 2003 : Ismail M.Romi, PPU. All Rights Reserved 1 Lab5 ListBox Control Properties, Methods and Events.
CA 121 Intro to Programming Tariq Aziz and Kevin Jones GUI Programming in Visual Studio.NET Chapter 3 Tariq Aziz and Kevin Jones.
Compunet Corporation Programming with Visual Basic.NET GUI Chapter 3 Week 13 Tariq Aziz and Kevin Jones.
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Ten String Manipulation and Menus.
Tutorial 7: Sub and Function Procedures1 Tutorial 7 Sub and Function Procedures.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Lab 9 – User Forms Design. User Forms What are user forms? –Known as dialog boxes –Major ways for getting user input An example of using user forms: Monthly.
Irwin/McGraw-Hill Copyright© 2000 by the McGraw-Hill Companies, Inc. PowerPoint® Presentation to accompany prepared by James T. Perry University of San.
Ch 11: Userforms CP212 Winter Topics Designing User Forms o Controls Setting Properties o Tab Order o Testing Writing Event Handlers o Userform_Initialize.
Multiple Forms and Standard Modules
1 Graphical User Interfaces Part 2 Outline ListBoxes and CheckedListBoxes ListBoxes CheckedListBoxes ComboBoxes.
Microsoft Word 2000 Presentation 5. Major Word Topics Columns Tables Lists.
Mouse Events. Mouse Driven Events Unlike control_click() which is passed no arguments (unless it's an index for an array), MouseDown, MouseUp and MouseMove.
6.3 List Boxes and Loops Some Properties, Methods, and Events of List Boxes List Boxes Populated with Strings List Boxes Populated with Numbers Searching.
Copyright © 2001 by Wiley. All rights reserved. Chapter 5: The Repetition Process in Visual Basic Event Driven Loops Determinate Loops Indeterminate Loops.
The Repetition Process in Visual Basic. The Repetition Process The capability to repeat one or more statements as many times as necessary is what really.
Chapter 9 - VB.Net by Schneider1 Chapter 9 – Additional Controls and Objects 9.1 List Boxes, Combo Boxes, and the File-Opening Control The List Box Control.
ListBox, ComboBox, Menu Chapter 5.4, ComboBox Control: Properties & Methods u Combines TextBox features with a short drop- down list  cboOne.AddItem(string)
1. Chapter 4 Customizing Paragraphs 3 More Paragraph Changes Highlight a paragraph in Word by applying borders and shading. Sort paragraphs to control.
Working with option button, check box, and list box controls Visual Basic for Applications 13.
Visual Basic.NET BASICS Lesson 3 Events and Code.
© 1999, by Que Education and Training, Appendix A, pages of Introduction to Computer Programming with Visual Basic 6: A Problem-Solving Approach.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 17 – Flag Quiz Application Introducing One-Dimensional.
Visual Basic Programming Chapter Six Notes Repetition and the Do Statement ADDING ICONS TO YOUR FORM –It is possible to add an ______________ to your title.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 20.1 Test-Driving the Shipping Hub Application.
Visual Basic Programming Introduction VB is one of the High level language VB has evolved from the BASIC language. BASIC stands for Beginners All-purpose.
Chapter 7 P 1 Lists and Loops List boxes and combo boxes List box - list of items - useful for a list which does not change Combo box - list of items -
Select (drop-down list) Inputs. Insert/Form/List Menu.
Chapter 7 - Lists, loops and printing w List boxes and combo boxes several types can add items at design time or during run time user select from predefined.
Slide 1 Using Menu Bar & Common Dialog Boxes. Slide 2 Setting Up the Main Items v First open the form on which you want the menu located v Then start.
COMPUTER PROGRAMMING I 3.02 Apply Properties Associated with the Controls.
Chapter 8.  Visual Basic includes several built-in mathematical functions ◦ Abs ◦ Sqr ◦ Sgn ◦ IsNumeric ◦ Round ◦ Format ◦ Pmt ◦ PV ◦ FV.
7-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
Controls. Common properties Height – Height of the control Left – Left of the control Width – width of a control Top - From the screen top Font – Foreground.
AdditionalControls 1. The MenuStrip 2 Double-click Let’s begin to design the menu bar for VB! Let’s begin to design the menu bar for VB! 3.
Iterations (aka Loops). 2 Loops Loops (iterations) are segments of code that may be executed several times. Fixed-count (definite) loops repeat a fixed.
Visual Basic.NET BASICS Lesson 11 List Boxes, For Next Loops, and Label Settings.
Unit 6 Repetition Processing Instructor: Brent Presley.
Input Boxes, List Boxes, and Loops Chapter 5. 2 Input Boxes Method for getting user’s attention to obtain input. InputBox() for obtaining input MessageBox()
IMS 3253: Controls 1 Dr. Lawrence West, MIS Dept., University of Central Florida Topics Check Boxes Radio Buttons Date Time Picker Masked.
Iterations (aka Loops). 2 Loops Loops (iterations) are segments of code (loop body) that may be executed several times. Fixed-count (definite) loops repeat.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
1 Organizing Information in Tables A table is information arranged in horizontal rows and vertical columns When you first insert a table into a document,
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 6 Looping and Multiple Forms.
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
CSCI 6962: Server-side Desig n and Programming ASP Server Controls.
Apply Procedures to Develop Menus, List Box and Combo Box Objects
Apply Procedures to Develop Menus, List Box and Combo Box Objects
The List Box Control Items can be placed into the list at design time or run time The Sorted property causes items in the list to be sorted automatically.
CIS 16 Application Development Programming with Visual Basic
Presentation transcript:

Lab4 ListBox Control Properties, Methods and Events

List Box An input box that displays a list of items from which a user can make the selection. Initializing the list box 1. You can initialize such list boxes from the List property (Design-time). 2. Initializing list boxes using procedures (run-time).

List Box Methods Additem: Adds an item to the listbox. lstBox.AddItem str RemoveItem : Removes one item from the list box. The statement lstBox.RemoveItem n deletes the item of index n from lstBox, the statement Clear : Removes all items from the listbox. lstBox.Clear

List Box Properties List: The string array lstBox.List( ) holds the list of items stored in the list box. In particular, the value of lstBox.List(n) is the item of lstBox having index n. ListIndex: The index of the selected listbox item,Starts from 0. The value of lstBox.ListIndex is the index number of the item currently highlighted in lstBox. (If no item is highlighted, the value of ListIndex is –1.)

List Box Properties ListCount: The number of the list items. Text: specifies the list box’s selected item. the value of lstBox.Text is also the currently highlighted item. Sorted: True/False Specifies whether or not the list box items are sorted

List Box Properties The value of lstBox.List(lstBox.ListIndex) is the item (string) currently highlighted in lstBox. NewIndex: The value of lstBox.NewIndex is the index number of the item most recently added to lstBox by the AddItem method.

Multiselection ListBox To select more than one item from a list box, you can do so after handling some properties like style, multiselection. Style (Design-time): 0: Specifies a standard ListBox style (Default). 1: Specifies a ListBox with CheckBox in front of each item. How can you Select/Deselect from this ListBox? You can do so by pointing to the item ( using the mouse or up and down arrows), then choosing the item( Click the mouse or the spaces bar)

Multiselect (Design-Time): 0 (None): Multiple selection not allowed. 1(Simple): Allows multiple selection. 2: (Extended): Allows multiple selection Holding the Shift key and selecting an item selects all selections between the last selection and the current selection. Important Note: When Multiselect property > 0, Style property should be 0

Selected (Run-Time): –True: The item is selected. –False: the item is deselected. Example: Print ListName.Selected(ListIndex) The result should be : True/False. Note: You can use this property in a loop to know what items are selected from the list.