tags:

views:

130

answers:

4

i am developing tab button as user control, how can i make it to behave as radiobutton. "When the user selects one option button (also known as a radio button) within a group, the others clear automatically". thank you.

+2  A: 
Bob
Why the downvote?
Bob
Because your answer makes no sense. What javascript? The question is not even about the web.
CannibalSmith
It makes fine sense if this is ASP.NET. He hasn't specified, but there is nothing in his question that would indicate it isn't.
Bob
Downvote is not appropriate in this case.
Mike C.
+1  A: 

obviously you need a container for the button, and whenever a usercontrol is selected, fire the event to container, and container deselect the other usercontrol

Benny
how you can do that? thanks
volody
+2  A: 

Say your custom Tab button Control is named MyTabButton, Override and implement Equals, and then in the Click event handler in your custom control class,

if (this.Checked)
   foreach(Control myBut in Parent.Controls)
       if (myBut is MyTabButton && !myBut.Equals(this))
          myBut.Checked = false;
Charles Bretana
A: 

Need more information as to if this is WindowsForms, WPF, ASP.NET etc.. but

If it is WPF I have written a post that explains my approach to solving this problem: Grouping and Checkboxes in WPF

Foovanadil