redirecting

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • navda
    New Member
    • Jan 2010
    • 9

    redirecting

    hi thanks a lot for answering me back....
    well i still have some doubts with previous solution

    private sub command1_click( )
    for n=0 tolist1.listcou nt-1
    if list1.selected( n) =true then
    list2.additem list1.list(n)
    list1.selected( n)=false
    end if
    next n
    end sub

    ok i got the point about the incrementation of next n=n+1.but i want to know that
    if n=0 means first index value of my list item and listcount means end value of my list item let it be 7 i.e, 6 by (list1.listcoun t-1)

    well what does list1.selected( n)=true means here.... is it saying that the index value between 0 to 6 is correct, or a condition which checks that i have selected the index value between 0 to 6....please make me clear

    as well i want to know if i select the items from list 1 having index value between 0 to 6 let it be index 3 and send it to list2.... then next n takes me to index 4 then index 5 then index 6(who does not respond and display any item name or send its value to list 2 because i have not selected those items)??? and if my loop condition ends the program ends and in the code as said (list1.selected (n)=false) makes my selected item false in list 1.

    so what happens if i select the same item next time how does for loop react does it makes again the value of n=0 and start from the begining?will there be any flow of previous loop in next selection....?? ?

    is this the concept here of for loop...please explain me....



    thanks looking forward...at(nv nrai8@gmail.com )
  • vb5prgrmr
    Recognized Expert Contributor
    • Oct 2009
    • 305

    #2
    You know, to get a lot of these answers you could highlight one of these properties and press F1. Help should then come up and you will be able to read all about it. For example...
    Selected Property


    Returns or sets the selection status of an item in a FileListBox or ListBox control. This property is an array of Boolean values with the same number of items as the List property. Not available at design time.

    Syntax

    object.Selected (index) [= boolean]

    The Selected property syntax has these parts:

    Part Description
    Object Anobject expression that evaluates to an object in the Applies To list.
    Index The index number of the item in the control.
    Boolean ABoolean expression specifying whether the item is selected, as described in Settings.


    Settings

    The settings for boolean are:

    Setting Description
    True The item is selected.
    False (Default) The item isn't selected.


    Remarks

    This property is particularly useful when users can make multiple selections. You can quickly check which items in a list are selected. You can also use this property to select or deselect items in a list from code.

    If the MultiSelect property is set to 0, you can use the ListIndex property to get theindex of the selected item. However, in a multiple selection, the ListIndex property returns the index of the item contained within the focus rectangle, whether or not the item is actually selected.

    If a ListBox control’s Style property is set to 1 (check boxes), the Selected property returns True only for those items whose check boxes are selected. The Selected property will not return True for those items which are only highlighted.

    Good Luck

    Comment

    Working...