在运行时创建列 [英] Creating columns at run time
本文介绍了在运行时创建列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好.
我希望有人能帮助我.
我有一个项目,必须在运行时使用系统反射来添加列表视图.
但是之后,我将无法添加列或添加行.
Hi everyone.
I hope some one can help me.
I have a project where i had to add a listview at run time using system reflection.
But after that i m not capable of adding columns or add rows.
Private Sub CreateLVLOGS()
Dim fullyQualifiedClassName As String = "System.Windows.Forms.ListView"
Dim o = BuscaInstancia(fullyQualifiedClassName)
Dim LVLOGS = CType(o, Control)
LVLOGS.Top = 205
LVLOGS.Left = 82
LVLOGS.BackColor = Color.WhiteSmoke
LVLOGS.Height = 645
LVLOGS.Width = 303
Panel5.Controls.Add(LVLOGS)
AddHandler LVLOGS.ColumnCreating, AddressOf ListView1_ColumnCreating
'AddHandler LVLOGS.Click, AddressOf AbrirPDfDestino_Click
'Addhandler LVLOGS.columnclick addressof listview_columnclick
End Sub
Private Sub ListView1_ColumnCreating(sender As Object, e As ListViewColumnCreatingEventArgs)
If e.Column.FieldName = "Name" OrElse e.Column.FieldName = "NAME" Then
e.Column.Visible = False
End If
End Sub
我不确定自己做错了什么.
如果有人可以帮助我.
谢谢您.
Im not sure what im doing wrong.
If some one could help me please.
Thank you in adavance.
推荐答案
Dim LVLOGS = CType(o,System.Windows.Forms.ListView)
Dim LVLOGS = CType(o, System.Windows.Forms.ListView)
这篇关于在运行时创建列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文