User Control question

  • Thread starter craig via DotNetMonster.com
  • Start date
C

craig via DotNetMonster.com

Ok, there is probably a very simple answere to this, but I'm a VB newbe and
this is completely stumping me.

I am trying to create a user control which will consist of a DataGrid and
several buttons which will be used throught our application. There is code
that will always be executed when a button on this control is clicked and
then there is code that will depend on which form the control is on.

So, I have placed the common code within the click event of the button at the
control level. My question is how to I detect the click of that button at
the form level, execute the form specific code and then execute the common
code at the control level?

Thanks,
Craig
 
M

Marina Levit [MVP]

Have the usercontrol raise an event. The form is responsible for handling
it, and running its code. After the usercontrol raises the event, it can go
ahead and execute the common code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,139
Latest member
JamaalCald
Top