开发者

How to disabled specific row in ListView

开发者 https://www.devze.com 2022-12-27 05:50 出处:网络
Can anyone help me on how can I disabled specific rows in ListView using vb.net 2003开发者_JAVA百科 language?Not sure what you mean with disable.

Can anyone help me on how can I disabled specific rows in ListView using vb.net 2003开发者_JAVA百科 language?


Not sure what you mean with disable.

You can't enable/disable ListViewItems but depending on what you want to do you can fake it in various ways. For example you can handle the ListView.SelectedIndexChanged event and unselect the items you didn't want the user to select. Possibly would need to combine that with changing the backcolor/forecolor of the items to make them look unselected again.

However, if you're able to use a different control, it might be worth considering a DataGridView instead of a ListView, it can be little more difficult to get started with but if you're going to be doing more advanced stuff than just showing a list it might be a lot easier.

0

精彩评论

暂无评论...
验证码 换一张
取 消