for I := 0 to ListBox1.Items.Count -1 do
begin
if ListBox1.Selected[I] then ListSelectItem := I;
ListBox1.Selected[I] := False;
end;
ListBox1.Selected[ListSelectItem] := True;
begin
if ListBox1.Selected[I] then ListSelectItem := I;
ListBox1.Selected[I] := False;
end;
ListBox1.Selected[ListSelectItem] := True;
上面我的代码在D下是通过的,是可以实现我所要的结果,但在VB.Net不知道应该怎么写哪位帮忙下呢
if ListBox1.Selected[I] is True then ListSelectItem = I
else
ListBox1.Selected[I] = False
end if
end for
if ListSelectItem >=0 and ListSelectItem <=ListBox1.Items.Count -1
ListBox1.Selected[ListSelectItem] = True
end if