- Код: Выделить всё
Public pObj As HostObject
Private mSelItem As ListViewItem
Private mObj As Plugin
Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim mDirInfo As DirectoryInfo, mFileInfo As FileInfo, mListItem As ListViewItem, plgModule As Plugin
mDirInfo = New DirectoryInfo(Application.StartupPath & "\plugin\")
For Each mFileInfo In mDirInfo.GetFiles("*.dll")
If mFileInfo.Name <> "PluginsHost.HostObject.dll" And mFileInfo.Name <> "DataInput.dll" Then
mListItem = New ListViewItem
mListItem.Text = mFileInfo.Name
plgModule = New Plugin(mFileInfo.FullName)
mListItem.Tag = plgModule
lstPlugins.Items.Add(mListItem)
End If
Next
lstPlugins.SelectedItem = lstPlugins.Items(0)
End Sub
Private Sub lstPlugins_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstPlugins.SelectedIndexChanged
mSelItem = lstPlugins.SelectedItem
mObj = CType(mSelItem.Tag, Plugin)
txtDescription.Text = mObj.Execute(pObj, "Description")
End Sub
Полуается следующее что текст мы добаляем в ListBox, с элементами ListViewItems. А как можно сделать для ListView?