if (SelectedIndex - 1) < 0 then Exit;
ListBox1.Items.Move(SelectedIndex, (SelectedIndex - 1));
ListBox1.ItemIndex := SelectedIndex - 1;
ListBox1.Selected[SelectedIndex - 1] := True;
//还有的自己研究吧,不难
SetFocus
count,i:integer
try
if ListBox1 = nil then
Exit;
Count := ListBox1.Items.Count;
if Count = 0 then
Exit;
for I := 0 to IndexCount - 1 do
ListBox.Selected[i] := False;
ListBox.Selected[0] := true;
except
end;
listbox1.Canvas.Brush.Color :=Clred;//背景
listbox1.Canvas.Font.Color :=Clred;//字体
end;
ADOQuery1.RecNo是只读的,不能加减,它是用来返回当前记录的记录号的。上下移动记录用ADOQuery1.Prior和ADOQuery1.Next。