private void newObjButton_Click(object sender, EventArgs e) { Meters meters2 = new Meters() { TotalIn = 358, TotalInValid = 6 }; Console.WriteLine(testLabel.DataBindings.Count); testLabel.DataBindings.Clear(); testNumericUpDown.DataBindings.Clear(); testLabel.DataBindings.Add(new Binding("Text", meters2, "TotalInShow")); testNumericUpDown.DataBindings.Add(new Binding("Value", meters2, "TotalInValid")); }
public Form1() { InitializeComponent(); meters = new Meters() { TotalIn = 1213, TotalInValid = 1 }; BindMeters(); String test; if (Decimal.TryParse(textBox1.Text, out Decimal resultOverwiteDenom)) { test = String.Format("overwrite_denomination = {0}", resultOverwiteDenom); } else { test = String.Format("overwrite_denomination = {0}", "NULL"); } }