How to change Listbox item position of Listbox using Up/Down arrow key?
I am having one listbox in my application, I am having fixed number of items inside say Item1 to Item10 arranged in sequence.
Now I want to move or change position of item10 (which is focused) at item1. I mean I want to move last item10 at 1st position in listbox using up arrow key....
I am not finding way to do that can any body guide me how can we do that?
Re: How to change Listbox item position of Listbox using Up/Down arrow key?
You can change the list element array and update the listbox when you receive the key event. Probably you should describe a bit more in what scenario would you want to add this behavior. Is it something like setting priority.
Re: How to change Listbox item position of Listbox using Up/Down arrow key?
[QUOTE=kamalakshan;838154]You can change the list element array and update the listbox when you receive the key event. Probably you should describe a bit more in what scenario would you want to add this behavior. Is it something like setting priority.[/QUOTE]
yes you are correct I want to set priority...
In listbox Options (Left Softkey), I will have Move menu, once Move Option will be selected, item focused in listbox should move in listbox using up/down key and once middle key is pressed item should be placed at position where it is moved.
Re: How to change Listbox item position of Listbox using Up/Down arrow key?
you can maintain two indexes , one for the item which is focused at the time when you have pressed 'Move' menu item(say iMovefocus) & second one , when the middle key is pressed(say iPressed).Now after middle key is pressed, remove the item which is at iMovefocus position in the array of listbox and at the same time , insert the same element into the array at the iPressed position in the array.
Also do remember to get the element name before removing it, so as to insert it at the changed position.