How to use control globally?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello all

If I have an app that is a 'WinFormsApp', and on the form I put a ListBox called 'ListBx'; then I add a generic clas
called 'GenClss', how do I add strings to the 'ListBx' from the 'GenClss'

TIA

Ray K
 
Ray,

In order to do this, you will have to pass the reference for the form
that contains the listbox to the GenClass (through a property, method,
field, etc, etc). Once you do that, an instance of GenClass can then access
the listbox (assuming you made it public), and add items to it.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

raykos said:
Hello all,

If I have an app that is a 'WinFormsApp', and on the form I put a
ListBox called 'ListBx'; then I add a generic class
 
Back
Top