0% found this document useful (0 votes)
1 views

Lab 6

Uploaded by

Ahmed Al-nasheri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Lab 6

Uploaded by

Ahmed Al-nasheri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Lab 6

ListBoxes

First: Review listBox control item and its main properties, methods and
default event.

Create the following form, and add a Listbox with the following items in it:

- Review the property SelectionMode and change its value (One,


MultiSimple, MultiExtended)
- Change the property Sorted into True, and check the effect.
- Add two labels to the form.
- In the first label, display the selectedItem (use the default event
SelectedIndexChanged).
- In the second label, display the selectedIndex. (check its value when no
items are selected)
- Discuss the properties SelectedItems and SelectedIndecies.
- If a user selects either C++ or C#, display a message "Welcome to C
languages". (hint: use method GetSelected)

1
- Add a button labeled "Count" and another label. When pressing the
button, display number of items in the listbox in the new label.

Second: Practice several actions on the listBox.

Create the following form:

Activate the displayed buttons as follows:

1. Add: Adds the item entered in the textbox into the listbox.
2. Remove: Removes the selected item in the listbox (Ex: Change it to
remove the written item in the textbox).
3. Clear List: Clears/removes all items in the listbox
4. Clear Selected: Removes the selection on items in the listbox.

2
Exercise 5:

Create the following form:

Activate the displayed buttons, so that:

1. > : moves the selected item from left listbox to the right one.
2. <: moves the selected item from right listbox to the left one
3. >>: moves all items from left listbox to the right one.
4. <<: moves all items from right listbox to the left one.

Change the code in > and < buttons, so that they move the selected
items.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy