hi all, how can I make a ListView public? so I can access it from my first form
thank you in advance
best regards
hi all, how can I make a ListView public? so I can access it from my first form
thank you in advance
best regards
The best approach is to create a public readonly property to the ListView, e.g.:
public ListView MyListView {
get {
return myPrivateListView;
}
}
By default when you drop a control on to a form the access modifier is private. You can simply go to the property screen of that control and scroll to Modifiers and set it to public or internal.
I personally dont encourage for you to expose the control from one form to the other. You should be able to easily achieve what you need to do through registering and raising events and let the form that owns the listview to handle it accordingly.