开发者

how to convert string to listviewitem?

开发者 https://www.devze.com 2023-01-15 02:46 出处:网络
I try to convert string to ListViewItem: ListViewItem str = (开发者_C百科ListViewItem)Convert.ChangeType(az, typeof(ListViewItem));

I try to convert string to ListViewItem:

ListViewItem str = (开发者_C百科ListViewItem)Convert.ChangeType(az, typeof(ListViewItem));

but it doesn't work. What is wrong in this code?


I am not sure I get why you are trying to change the type of a string to ListViewItem. I'm pretty sure that what you actually want to do is create a ListViewItem out of a string using regular construction:

ListViewItem item = new ListViewItem(az);
0

精彩评论

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