accessing methods in user control

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

Guest

Basically when auser clicks on a button on my form I want my user control to
be loaded

"ctlAddProject controlAddProject;Controls.Add(controlAddProject);"

which is easy enough.
Now there is a public method called doBind(string fName) on the control
which I want to call from the parent form passing the appropriate string.
If the control was added at design time I could do something like :

controlAddProject.doBind("StringHere");

How do I do this now the control is added at run time ?
 
poppy,

I don't understand what you want to do at run time.
When the client clicks on the button just create the control, add it to the
Controls collecion and call the doBind method.
What else you want to do?
 
The problem is that I cant run the doBind() method of the user control from
the parent form when I add the control at run time.

controlAddProject.doBind("StringHere"); does not work !!!
 
BTW can you create some simple sample that demonstrates your problem. I
don't know if it's just me, but I don't quite understand the problem. Given
the fact that no one else answers probably the others don't get it too.
 
Back
Top