Autor Beitrag
Chris1308
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 220

Win XP Prof.
D2005 Prof, D7 Prof, D7 Pers
BeitragVerfasst: Di 25.06.02 15:55 
Hi @all!
Ich habe auf meinem Form 2 ListBoxen (1 ist nicht sichtbar).
Nun will ich klicke ich einen Eintrag in der 1. Listbox an und will das dieser auf Button-Klick um eine Stelle nach oben verschoben wird. Dazu muss aber der Eintrag an der gleichen Stelle in der anderen Listbox ebenfalls nach oben verschoben werden!

Chris1308
Teutobod
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 55



BeitragVerfasst: Di 25.06.02 16:57 
Hallo Chris1308!

Ich rechne mal damit, daß deine zweite ListBox die gleiche Reihenfolge hat wie die erste.
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
  
procedure TForm1.ListBox1Click(Sender: TObject);
var i : Integer;
begin
for i := 0 to listbox1.Items.Count-1 do
    begin
    if listbox1.Selected[i] then
      begin
      listbox1.Items.Move(i, i-1);
      listbox2.Items.Move(i, i-1);
      end;
    end;
end;

Sonst ist es wenigstens mal ein Ansatz.

mfg Teutobod