public static void ShowKeyboard(KeyWorkChangeHandler deleg) { if (ins == null) { ins = new ChooseGoods2(); } else if (ins.IsDisposed == true) { ins = new ChooseGoods2(); } ins.Show(); ins.timer2.Enabled = true; ins.deleg = deleg; ins.Top = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height; ins.Left = System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width - ins.Width; ins.runStatus = -1; ins.TopMost = true; ins.keyword = ""; ins.deleg.Invoke(ins.keyword); }
private void lbl_Click(object sender, EventArgs e) { Control con = (Control)sender; try { switch (con.Text) { case "销售退货": newOrder(con.Text); break; case "输入客户": hideKeyboard(); ChooseCus frm = new ChooseCus(); var item = frm.Select(); if (item != null) { lblcussup.Text = item.supcust_no + "/" + item.sup_name; supcus_no = item.supcust_no; } panel2.Refresh(); break; case "找商品": ChooseGoods2.ShowKeyboard(KeywordChange); break; case "取重": case "手输数量": inputQty(con.Text); break; case "现结": CashPayOrder(); break; case "挂账/预付": CreditPayOrder(); break; case "归零": hideKeyboard(); Program.ReadWeight.set0(); break; case "去皮": hideKeyboard(); Program.ReadWeight.qupi(); break; case "退出": hideKeyboard(); if (lines.Count != 0) { if (new YesNoForm("退出前是否保存本单据?").ShowDialog() == DialogResult.Yes) { CashPayOrder(); } this.Close(); } else { if (new YesNoForm("确定退出收银?").ShowDialog() == DialogResult.Yes) { this.Close(); } } break; } } catch (Exception ex) { new MsgForm(ex.GetMessage()).ShowDialog(); } }
//隐藏找商品小键盘 private void hideKeyboard() { ChooseGoods2.HideKeyboard(); }