|
-
May 3rd, 2005, 03:34 AM
#1
Thread Starter
Supreme User
DELPHI - Moving Listbox Items?
A few weeks back, i started making a project on my own, easily discovered how to move a list item up and down the list:
Code:
lstMain.Items.Move(lstMain.ItemIndex,lstMain.ItemIndex -1);
My question comes here, which i feel ridicolous for asking
1) When you move the item, how do you keep it selected? If i press a up button for example, i always have to click the item, then the button, when really i should'nt
2) How do you stop the first, and last item in the list from been moved?
CHEERS
-
May 4th, 2005, 09:55 AM
#2
Thread Starter
Supreme User
Re: DELPHI - Moving Listbox Items?
-
May 4th, 2005, 01:22 PM
#3
Re: DELPHI - Moving Listbox Items?
I am not sure what you mean.
-
May 4th, 2005, 01:36 PM
#4
Thread Starter
Supreme User
Re: DELPHI - Moving Listbox Items?
Imagine, a listbox, a command button for up, and one for down. There are the following items in the list:
1
2
3
4
5
6
7
8
9
If i highlight 9 (the blue bar highlights the 9) and press the up button, the 9 will swap places with 8 right. Thats hunky dorky, but when i press that button, the listbox loses focus of the 9, meaning the blue bar is no longer over the 9 (so the user would have to re-click the item again)
Is that better?
-
May 4th, 2005, 01:54 PM
#5
Re: DELPHI - Moving Listbox Items?
You would do as you would do in VB:
-
May 4th, 2005, 01:55 PM
#6
Thread Starter
Supreme User
-
May 4th, 2005, 04:24 PM
#7
New Member
Re: DELPHI - Moving Listbox Items?
Why don't you use a special key to move items up and down. In some list boxes, you can move items by holding down the control key and pressing the up and down arrows. 
P.s: Merry Christmas
I am the real Santa Clause 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|