private void OnMouseUp(object sender, MouseEventArgs e) { if (sender is TextBox txt) { var frm = new frmNumpad(txt); frm.SetLocation(txt.Right, txt.Top); frm.FormClosed += (s, ea) => { var dto = new PrinterInfoDto(); if (!String.IsNullOrEmpty(txtPrinterSpeed.Text)) { if (Int32.TryParse(txtPrinterSpeed.Text, out var i)) { dto.PrinterConveyorSpeed = i; } } if (!String.IsNullOrEmpty(txtInfeedSpeed.Text)) { if (Int32.TryParse(txtInfeedSpeed.Text, out var j)) { dto.InfeedSpeed = j; } } _pviController.SetVariables(dto); }; frm.Show(); } }
private void OnMouseUp(object sender, MouseEventArgs e) { if (sender is TextBox txt) { var frm = new frmNumpad(txt); frm.SetLocation(txt.Right, txt.Top); frm.FormClosed += (s, ea) => { SetCurrentBox(); SetLableDistance(); }; frm.Show(); } }
private void OnMouseUp(object sender, MouseEventArgs e) { if (sender is TextBox txt) { var frm = new frmNumpad(txt) { MaxValue = 100.00M }; frm.SetLocation(txt.Right, txt.Top); Point location = txt.PointToScreen(Point.Empty); var x = location.X - frm.Width / 2; var y = location.Y + 30; frm.Location = new Point(x, y); frm.Show(); } }