I'd like to be able to catch the DoubleClick or MouseDoubleClick events from a standard winforms radio button, but they seem to be hidden and not working. At the moment I have code like this:
public class RadioButtonWithDoubleClick : RadioButton
{
public RadioButtonWithDoubleClick()
: base()
{
this.SetStyle( ControlStyles.StandardClick | ControlStyles.StandardDoubleClick, true );
}
[EditorBrowsable( EditorBrowsableState.Always ), Browsable( true )]
public new event MouseEventHandler MouseDoubleClick;
protected override void OnMouseDoubleClick( MouseEventArgs e )
{
MouseEventHandler temp = MouseDoubleClick;
if( temp != null ) {
temp( this, e );
}
}
}
Is there a simpler and cleaner way to do it?
Edit: For background, I agree with Raymond Chen's post here that the ability to double click on a radio button (if those are the only controls on the dialog) makes the dialog just a tiny bit easier to use for people who know about it.
In Vista using Task Dialogs (see this Microsoft guideline page or this MSDN page specifically about the Task Dialog API) would be the obvious solution, but we don't have the luxury of that.