开发者

make a class convertible to another class vb.net

开发者 https://www.devze.com 2022-12-15 03:13 出处:网络
Is it possible to make my custom item class so that I can put it straight into a 开发者_运维技巧listviewitem?

Is it possible to make my custom item class so that I can put it straight into a 开发者_运维技巧listviewitem? What I mean is a listview and I want to be able to do Listview.items(0) = Item

Or is this not possible?


You can make your class derive from ListViewItem

Public Class MyItem
    Inherits ListViewItem

    ....

End Class

This allows you to use MyItem in all places where a ListViewItem is accepted.

0

精彩评论

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