selecting a list element...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • libish
    New Member
    • Oct 2008
    • 42

    selecting a list element...

    hi all,
    can any one suggest me on selcting a list element?

    i am displaying a list containing some items dynamically...
    after displaying the content and the form holding this list, i need to select elements by pressing up/down button on the mobile phone...

    at times by default i'm able to select items by clicking on the up/down buttons...
    but i need a reliable solution for this...
    can any one help me...

    i'm using c#.net, the project is for windows mobile...
  • markmcgookin
    Recognized Expert Contributor
    • Dec 2006
    • 648

    #2
    The selected index of the item is what you need... so something like

    Code:
    this.myListBox.selectedIndex = 1;
    this may be selectedItem, items.selectedI temIndex or something similar, this is just off the top of my head

    then on your buttons
    Code:
    this.myListBox.selected index = this.myListBox.SelectedIndex + 1;
    and for down

    Code:
    this.myListBox.selected index = this.myListBox.SelectedIndex - 1;

    Comment

    Working...