* New post Constructor Destructor and Inheritance& Array , Virtual base class in c++ language

Sunday, 3 March 2013

0 LIST BOXES,COMBO BOXES,CHECKED LISTBOXES

LISTS BOXES,COMBO BOXES

The Lists boxes can displays a list of items from which you can select one or more. If there are too many items to display at once , a scroll bars automatically appears in the lists box. You can also scroll list boxes horizontally when we set the muticolumn property to true.The item in list boxes are stored in the ITEMS COLLECTION ; the ITEMS.COUNT Property holds the number of items in the list. To add or delete  items in a lists box control ,we can use the items.add,items.insert() , items.clear(), items .Remove(), or items. RemoveAt() method.
You can also use the BEGINUPDATE  and ENDUPDATE methods .These enable you to add a large number of items to the lists box without the listbox being redrawn each time an item is added to the list. The FINDSTRING and FINDSTRINGEXACT method enable you to search for an item in the list that contain a specific search strings.
You can also support multiple selection in lists boxes. The selectionmode property determines how many list items can be selected at a time ; you can set this property to none,one, multisimple,or multiextended.

  • MULTIEXTENDED=Multilple items can be selected ,and the user can use the shift,ctrl, and arrow keys to make selections.
  • MULTISIMPLE=Multiple items can be selected.
  • NONE= No items may be selected.
  • ONE = Only one item can be selected.
                                          LISTS BOX PROPERTIES

  • ITEMS= Return a collection of the item of the list box.
  • MULTICOLUMN= Sets ,if the listbox control multiple column.
  • SELECTED ITEM= Sets , the selected item in the list box.
  • SELECTED ITEMS= Gets a collection containing the list box selected items
  • SORTED= Sets , if teh items in the list box are sorted .The sort is alpha.
  • TEXT= Gets the text of the selected item in the list box.
  • CLEAR SELECTED =Unselected all the items in the list box.


                                                 LISTS BOX EVENTS

  • SELECTEDINDEXCHANGED= Occurs ,when the selectedindexchanged property has changed.


                                   ADDING ITEMS IN LISTBOXES

We can add items to a list box at either design time or atruntime. Atruntime ,the first item will have index '0' , the next index 1 and so on, design time , we can use the items property.                
                          CODING AT RUNTIME TO AD THE ITEM IN THE LIST BOX 


* Listbox1.items.add(textbox1.text)
                        REMOVING ITEM FROM A LISTBOXES
We can remove items to a list box at REMOVEAT method or remove method.
                                              CODING
*If listbox1.ITEMS.COUNT =0 then
msgbox("nothing to delete")
else
If listbox1.ITEMS.COUNT=1 then
listbox1.items.REMOVEAT(0)
else
If listbox1.ITEMS.COUNT=0 then
listbox1.items.REMOVEAT(listbox1.items.count-1)
else
listbox1.items.REMOVEAT(listbox1.selected index)
end if
end if
end if
                               CLEAR ITEM IN  THE LIST BOXES
  *  List box1.items.clear
                                   COMBO BOXES
The combo box control is used to display data in the dropdown combo box. The combo box is madeup of two parts _ The top part is a text box that allow to type in all. The other parts is a list box that displays a list of items. To add or delete items in a combo box control ,use the :ITEMS.ADD(),ITEMS.INSERT(),ITEMS.CLEAR(),ITEMS.REMOVE(),ITEMS.REMOVEAT()

                          COMBO BOX PROPERTIES

  • ITEMS= Return a collection of the item of the combo box.
  • MULTICOLUMN= Sets ,if the listbox control multiple column.
  • SELECTED ITEM= Sets , the selected item in the combo box.
  • SELECTED ITEMS= Gets a collection containing the combo box selected items
  • SORTED= Sets , if teh items in the list box are sorted .The sort is alpha.
  • TEXT= Gets the text of the selected item in the combo box.
  • CLEAR SELECTED =Unselected all the items in the combo box.


                                                 COMBO BOX EVENTS


  • SELECTEDINDEXCHANGED= Occurs ,when the selectedindexchanged property has changed.


                                   ADDING ITEMS INCOMBOBOXES

We can add items to a combo box at either design time or atruntime. Atruntime ,the first item will have index '0' , the next index 1 and so on, design time , we can use the items property.                
                          CODING AT RUNTIME TO AD THE ITEM IN THE COMBO BOX 


*combo box1.items.add(textbox1.text)
                        REMOVING ITEM FROM A COMBOBOXES
We can remove items to a list box at REMOVEAT method or remove method.
                                              CODING
*If combo box1.ITEMS.COUNT =0 then
msgbox("nothing to delete")
else
If combobox1.ITEMS.COUNT=1 then
combo box1.items.REMOVEAT(0)
else
If combobox1.ITEMS.COUNT=0 then
combo box1.items.REMOVEAT(combobox1.items.count-1)
else
combobox1.items.REMOVEAT(combobox1.selected index)
end if
end if
end if
                               CLEAR ITEM IN  THE COMBO BOXES
  *  combo box1.items.clear
CHECKED LISTS BOXES
Checked list box are derived from standard lists box,expects that they can also support a checkbox for each item.Checked list box can also support  three states such as checked ,unchecked, indeterminate.
You can handle the checked items with the checkeditems property and the checkedIndices property .You can also use the GETITEMCHECKED method to verify if an item is checked .And you can use the ITEMCHECK event to handle check events ,and the SETITEMCHECKED method to check or uncheck items .

                CHECKED LISTS BOXES PROPERTIES

  • CHECKED INDICES= Holds the collection of checked indices in the checked list box.
  • CHECKEDITEMS= Holds the collection of checked items in the checked lists box
  • CHECKONCLICK= Sets if the checkedbox should be toggled when the corresponding item is selected.
  • ITEMS= Return a collection of items in the checked lists box.
  • MULTICOLUMN= Sets if the checked lists box allows multi columns. 
  • SELECTEDITEMS= Gets a collection containing the selected items in the checked list box.
  • TEXT= Gets the text of the selected item in a checked list box.
  • SORTED= Sets if the items in the checked lists box should be sorted . The sort is alphabetical. 
  • TOP INDEX= Sets the index of the first item that is visible in the checked list box.
                       CHECKED LISTS BOX EVENTS

  • ITEMCHECK= Occurs , when an item 's checked state changes 
  • SELECTED INDEX CHANGED= Occurs , when the selectedindex property  has changed.

0 comments:

Post a Comment

 

PROGRAMMINGqueen Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates

Blogger Widgets