user control and events

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

Hi,
I've got a user control with a method called Collapse. I would like
that when this method is called (it's only called inside the user
control, never by the client), an event can be caught.
So my client form can catch an event such as OnCollapse.
HOw can I do that ? Syntax ?

Thx
 
Hi in your usercontrol declare OnCollapse as a public event
Public Event yourEvent()

Then inside the method collapse call the event with raiseevent like this:
RaiseEvent OnCollapse

Now on your form your usercontrol has got an extra event, called OnCollapse
which you can catch

Hth Greetz Peter
 
Hi,

Add an event to the usercontrol that you raise in collapse
procedure.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vblr7/html/vastmEvent.asp

Ken
---------------------
Hi,
I've got a user control with a method called Collapse. I would like
that when this method is called (it's only called inside the user
control, never by the client), an event can be caught.
So my client form can catch an event such as OnCollapse.
HOw can I do that ? Syntax ?

Thx
 

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

Back
Top