示例#1
0
 private void SetField(NumericUpDown field, int value)
 {
     if (field.InvokeRequired)
         field.Invoke(new MethodInvoker(() => SetField(field, value)));
     else
         field.Value = value;
 }
 public static void SetMaxTS(this NumericUpDown x, Decimal s)
 {
     if (x.InvokeRequired)
     {
         x.Invoke(new EventHandler(delegate(object o, EventArgs a)
         {
             x.SetMaxTS(s);
         }));
     }
     else
     {
         x.Maximum = s;
     }
 }
 public static Decimal GetValueTS(this NumericUpDown x)
 {
     if (x.InvokeRequired)
     {
         Decimal m_ret = 0;
         x.Invoke(new EventHandler(delegate(object o, EventArgs a)
         {
             m_ret = x.GetValueTS();
         }));
         return(m_ret);
     }
     else
     {
         return(x.Value);
     }
 }
示例#4
0
 internal static void SetValue(NumericUpDown control, decimal value)
 {
     if (control.InvokeRequired)
     {
         control.Invoke(new SetValueDelegate(SetValue), new object[] { control, value });
     }
     else { control.Value = value; }
 }
示例#5
0
 public void SetNumericBox(NumericUpDown box, decimal val)
 {
     box.Invoke(new SetNumericDelegate(SetNumericHelper), new object[] { box, val });
 }
示例#6
0
文件: DROC.cs 项目: khaha2210/radio
 void SetValueNumeric(NumericUpDown nmr, decimal content)
 {
     try
     {
         if (nmr.InvokeRequired)
         {
             nmr.Invoke(new SetValue4Numeric(SetValueNumeric), new object[] { nmr, content });
         }
         else
             nmr.Value = content;
     }
     catch
     {
     }
 }
示例#7
0
 public static Decimal readNumericUpDownDecimal(NumericUpDown varControl)
 {
     Decimal foo = 0;
     if (varControl.InvokeRequired)
     {
         varControl.Invoke((MethodInvoker)delegate
         {
             foo = varControl.Value;
             //return varControl.Value;
         });
         return foo;
     }
     else
     {
         Decimal varDecimal = varControl.Value;
         return varDecimal;
     }
 }