|
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
namespace CommonTools
{
public class MyRadioButton : RadioButton
{
public MyRadioButton()
{
}
object m_checkedValue = null;
public object CheckedValue
{
get { return m_checkedValue; }
set {}
}
public void AddDatabinding(MyBindingSource datasource, string datamember, object controlValue)
{
m_checkedValue = controlValue;
DataBindings.Add(new RadioButtonBinder("CheckedValue", datasource, datamember));
}
protected override void OnCheckedChanged(EventArgs e)
{
base.OnCheckedChanged(e);
if (Checked && DataBindings != null && DataBindings.Count > 0)
{
BindingWithNotify binding = DataBindings[0] as BindingWithNotify;
if (binding != null)
binding.WriteNotify();
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.