AR
Aryana
November 19, 2002 12:01 PM UTC
Ok so I have figure out what I need to do but am not sure how to write the code to do that. What I want to do is create an event on my user control that is fired whenever any of the CheckChanged events from any of the radio buttons occur. Then I want to write an event handler in your form.
So in my user control I declare a delegate and then an event of that delegate type:
public delegate void EventHandler(object sender, System.EventArgs e); (this is outside of the user control class)
public event EventHandler CheckedChanged;
But now I am not sure what to do. I am not sure how to call that the event in the CheckedChanged event of each of the radio buttons. And then I don't really know how to deal with that in the form. If anyone could help me out, that would be great.
Thanks,
Aryana
AD
Administrator
Syncfusion Team
December 7, 2002 10:26 PM UTC
u dont have to write ur own delegate at all
do it like this:
u first write the general click event which u wish to handle all events from all radioButtons ,lets say radioButton1_Click.
then in the code editor ull see a region entitled
"Windows form designer generated code".Expand it and add following to the code:
this.radioButton1.Click += new System.EventHandler(this.radioButton1_Click);
similarly attached all the click events handler to the same one ,here is this.radioButton1_Click
this.radioButton2.Click += new System.EventHandler(this.radioButton1_Click);
this.radioButton3.Click += new System.EventHandler(this.radioButton1_Click);
and so on