急,帮忙把一段D的代码改成VB.NET的

winstonbonaparte 2009-10-21 09:27:39
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;
...全文
48 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
taoyanchounanren 2009-11-30
  • 打赏
  • 举报
回复
for I = 0 to ListBox1.Items.Count -1 do  
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
winstonbonaparte 2009-10-22
  • 打赏
  • 举报
回复
实际上我是想实现当我点击ListBox空白处的时候,能让ListBox选中状态都变成未选中状态。默认的情况下点击空白的地方,上一次选中的行数还是有蓝底的。
上面我的代码在D下是通过的,是可以实现我所要的结果,但在VB.Net不知道应该怎么写

哪位帮忙下呢
winstonbonaparte 2009-10-21
  • 打赏
  • 举报
回复
ListBox1这是个ListBox,我不知道在D下的Selected这个属性在VB.NET下有没有。

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧