私は、numericUpDown コントロール minValue - 0 maxValue - 100 を持っています。
このコントロールへのバインドを作成します。
値が 101 に変更された場合は例外になりますが、これは必要ありません。値は特に言及されていません。どうやってするの ?
アップデート:
BindinHelper.BindField(this.nUpDownExecArea, "Value", TempConfigClass, "ExecArea");
BindField:
public static void BindField(Control control, string propertyName,
object dataSource, string dataMember)
{
Binding bd;
for (int index = control.DataBindings.Count - 1; (index == 0); index--)
{
bd = control.DataBindings[index];
if (bd.PropertyName == propertyName)
control.DataBindings.Remove(bd);
}
control.DataBindings.Add(propertyName, dataSource, dataMember, false, DataSourceUpdateMode.OnPropertyChanged);
}
設定しました TempConfigClass.ExecArea = 99999;
エラーにはなりませんが、エラーがnumericUpDownのように見えるタブ(tabcontrol)に移動すると