using System; using System.Collections.Generic; using System.Data; using System.Drawing; using System.Runtime.InteropServices; using System.Text; using System.Threading; using System.Windows.Forms; using UAS_MES_NEW.DataOperate; using UAS_MES_NEW.PublicForm; using UAS_MES_NEW.PublicMethod; namespace UAS_MES_NEW { public partial class Form1 : Form { DataHelper dh; DataTable dt = new DataTable(); DataTable dbfind; private void Pr_code_DbChange(object sender, EventArgs e) { dbfind = pr_code.ReturnData; BaseUtil.SetFormValue(this.Controls, dbfind); } private void Form1_Load(object sender, EventArgs e) { //Com.PortName = "COM4"; //Com.ReadTimeout = 5000; //Com.WriteTimeout = 5000; //Com.BaudRate = 9600; //Com.StopBits = StopBits.One; //Com.Parity = Parity.None; dh = new DataHelper(); pr_code.FormName = Name; pr_code.SetValueField = new string[] { "pr_code" }; pr_code.TableName = "product"; pr_code.SelectField = "pr_code # 物料编号,pr_detail # 物料名称,pr_kind # 物料种类,pr_spec # 物料规格"; pr_code.DbChange += Pr_code_DbChange; } private void button3_Click_1(object sender, EventArgs e) { //md = new ModeBusTCPServer(); //md.Open(); //txtMsg.AppendText("SUCCESS"); //int a = GetHashCode(); //MessageBox.Show(a.ToString()); //string password = Encryption.EncryptStr("hcsy"); //MessageBox.Show(password); //string really = Encryption.DecryptStr(password); //MessageBox.Show(really); //byte[] date = new byte[] { 1, 2, 3, 4, 5 }; //string aaa = Encoding.ASCII.GetString(date); //Console.WriteLine(aaa); SetCheck st = new SetCheck("OK", Color.Green); BaseUtil.SetFormCenter(st); st.ShowDialog(); } private void button4_Click(object sender, EventArgs e) { //md.SendOrder(enterTextBox2.Text); } private void timer1_Tick(object sender, EventArgs e) { //char[] s = new char[] { }; //IntPtr st = GetForegroundWindow(); //StringBuilder sb = new StringBuilder(512); //GetWindowText(st, sb, sb.Capacity); //if (sb.ToString() != this.FindForm().Name) { // //SendKeys.Send("~"); // Console.WriteLine(sb.ToString()); //} } private void tabNavigationPage2_Paint(object sender, PaintEventArgs e) { } private void dataNavigator1_Click(object sender, EventArgs e) { } private void dataNavigator1_ButtonClick(object sender, DevExpress.XtraEditors.NavigatorButtonClickEventArgs e) { //下一页 if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.NextPage) { Console.WriteLine("A"); } //上一页 if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.PrevPage) { Console.WriteLine("B"); } //首页 if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.Next) { Console.WriteLine("C"); } //尾页 if ((e.Button).ButtonType == DevExpress.XtraEditors.NavigatorButtonType.Prev) { Console.WriteLine("D"); } } } }