HELP!!! raising events from a custom control 
Author Message
 HELP!!! raising events from a custom control

hi,

i have a custom control .... which inturn has a control in
it , say a command button (command button is dragged and
dropped on custom control screen , custom contro is not
inherited by command button) and like this i also have few
more windows form controls in my custom control.

now if i drag and drop my custom control on any form, it
will expose only those events which i have explicitly
declared in my custom control. along with my custom custom
events i have defined , i also want  my control to expose
all the events of command button( any windows form
control , for that matter) that i have dropped on my
custom control screen.

one way is to, handle all the command button events in my
custom control and in turn raise a custom event which will
have to be handled by client form on which the custom
control is placed ... but it is a major task..is there a
simple way of exposing all the events of a windows form
control in my custom control

guru



Fri, 29 Jul 2005 15:18:01 GMT  
 HELP!!! raising events from a custom control

Quote:
> i have a custom control .... which inturn has a control in
> it , say a command button (command button is dragged and
> dropped on custom control screen , custom contro is not
> inherited by command button) and like this i also have few
> more windows form controls in my custom control.

> now if i drag and drop my custom control on any form, it
> will expose only those events which i have explicitly
> declared in my custom control. along with my custom custom
> events i have defined , i also want  my control to expose
> all the events of command button( any windows form
> control , for that matter) that i have dropped on my
> custom control screen.

> one way is to, handle all the command button events in my
> custom control and in turn raise a custom event which will
> have to be handled by client form on which the custom
> control is placed ... but it is a major task..is there a
> simple way of exposing all the events of a windows form
> control in my custom control

As your control is not a command button, you have to a) delegate all the
events or b) make the command button public so that clients of your control
can handle the events of the button.

Armin



Fri, 29 Jul 2005 16:26:42 GMT  
 HELP!!! raising events from a custom control
hi,

making command button public will expose only the
properties and methods..how do u make it to expose its
events(as it does properties and methods)
when we delegate the events, we have to delegate each and
every events individually , right?

Quote:
>-----Original Message-----

>> i have a custom control .... which inturn has a control
in
>> it , say a command button (command button is dragged and
>> dropped on custom control screen , custom contro is not
>> inherited by command button) and like this i also have
few
>> more windows form controls in my custom control.

>> now if i drag and drop my custom control on any form, it
>> will expose only those events which i have explicitly
>> declared in my custom control. along with my custom
custom
>> events i have defined , i also want  my control to
expose
>> all the events of command button( any windows form
>> control , for that matter) that i have dropped on my
>> custom control screen.

>> one way is to, handle all the command button events in
my
>> custom control and in turn raise a custom event which
will
>> have to be handled by client form on which the custom
>> control is placed ... but it is a major task..is there a
>> simple way of exposing all the events of a windows form
>> control in my custom control

>As your control is not a command button, you have to a)
delegate all the
>events or b) make the command button public so that

clients of your control

- Show quoted text -

Quote:
>can handle the events of the button.

>Armin

>.



Sat, 30 Jul 2005 14:35:50 GMT  
 HELP!!! raising events from a custom control

Quote:
> making command button public will expose only the
> properties and methods..how do u make it to expose its
> events(as it does properties and methods)

AddHandler TheForm.TheButton.Click, AddressOf OnButtonClick
'...
sub OnButtonClick( _
    ByVal sender As System.Object, ByVal e As System.EventArgs)
    '...
end sub

Quote:
> when we delegate the events, we have to delegate each and
> every events individually , right?

Right.

Armin



Sat, 30 Jul 2005 19:45:06 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Raising Custom Active X Controls Events when using Data Repeater Control

2. Raising Custom Events on a Custom OCX

3. Raising Custom Events in an OCX Control

4. Help Raising Events in User Controls

5. Need help with raising event in New() event in a base form

6. raising an event from an activeX control on a htm page in a webbrower control

7. raising an event from an activeX control on a htm page in a webbrower control

8. HELP: Custom control array and Events???

9. Detecting which control raised an event

10. How to Raise/Simluate an Event via Code for a existing Control

11. Q: Raising events in webbrowser control

12. Event from dynamically created control doesn't raise

 

 
Powered by phpBB® Forum Software