Accessing listview items
How do I access the items of a listview which in a another form inside a panel.
The Listview is inside a Panel........开发者_C百科Panel1
Panel1 is in a Form ..................Form 1
I have another form .........Form2, from where I want to input items to Listview in Form 1
You can access the Form1 listview items from Form2 using this:
Form1.ListView1.Items(...)
Be careful accessing controls from other forms -- you can accidentally cause events to fire which can make confusing errors. Sometimes it's safer to assign the items to global variables or parameters for use in other forms.
精彩评论