![]() |
|
#1
|
|||
|
|||
|
Hi,
how do you get to move the selected item to move up or down? Without drag in drop. I'd like to use two buttons for it. thanks! edit: I think I got it: procedure TFormProductieAgendaSettings.btGebruikerUpClick(Se nder: TObject); var iI: Integer; sTemp: string; begin if lstGebruikers.ItemIndex <> -1 then begin if not lstGebruikers.ItemIndex = 0 then begin iI := lstGebruikers.ItemIndex; sTemp := lstGebruikers.Items[iI]; lstGebruikers.Items[iI] := lstGebruikers.Items[iI + 1]; lstGebruikers.Items[iI+1] := sTemp; end end end; procedure TFormProductieAgendaSettings.btGebruikerDownClick( Sender: TObject); var iI: Integer; sTemp: string; begin if lstGebruikers.ItemIndex <> -1 then begin if not lstGebruikers.ItemIndex = lstGebruikers.Count -1 then begin Ii := lstGebruikers.ItemIndex; sTemp := lstGebruikers.Items[iI]; lstGebruikers.Items[iI] := lstGebruikers.Items[iI-1]; lstGebruikers.Items[iI-1] := sTemp; end end end; Last edited by Red86; 02-09-2010 at 02:59 PM. |
|
#2
|
|||
|
|||
|
NB: This only works this way if there's no data assigned!!!
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|