On an interface only listbox control and two command buttons "up" and "down", select an item in the listbox control, press the "up" button, the current option is up to its previous position before a, on the contrary, down to it the following options below before
How to do this problem?
CodePudding user response:
The integer li_indexLi_index=lb. Selectedindex ()
Move up
If li_index & lt;=1 then
Return
End the if
Lb. Setsate (li_index, false)
Lb. Setsate (li_index - 1, true)
//////////
Down, to determine whether it has been to the last one, if is not respond, if you want to run to the first, write their own
Lb. Setsate (li_index, false)
Lb. Setsate (li_index + 1, true)
CodePudding user response:
Feel it's not a good way to first remove and insert again