calling method from one class without declaring the class again??

  • Thread starter Thread starter c#2006user
  • Start date Start date
C

c#2006user

hi

if i want to do this in c#, where HomePage_MainListSelected() is in
another class than this code , how do i do it? becaise
HomePage_MainListSelected does not exist in the current context
according to the comiler.

the class HomePage_MainListSelected() is in, inherits from the class
the events are declared in.
also the class which HomePage_MainListSelected() is the one that is
originally instantiated from the main class.



this.mainList.Selected += new
dmControls.ListControl.SelectedEventHandler mainList_Selected);

MainListSelectedEvent += new MainListSelectedEventHandler(
HomePage_MainListSelected);

regards
bryan
 
no its not, think i got around it i assigned it in that class and it
seemed to work

thanks
 
c#2006user said:
if i want to do this in c#, where HomePage_MainListSelected() is in
another class than this code , how do i do it? becaise
HomePage_MainListSelected does not exist in the current context
according to the comiler.

the class HomePage_MainListSelected() is in, inherits from the class
the events are declared in.
also the class which HomePage_MainListSelected() is the one that is
originally instantiated from the main class.

It's not entirely clear what you mean.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 
Back
Top