static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Form1 fm1 = new Form1(); Form2 fm2 = new Form2(); Form3 fm3 = new Form3(); fm3.Show(); fm2.Show(); Application.Run(fm1); }
private void button2_Click(object sender, EventArgs e) { try { string myconnection = "datasource=localhost;port=3306;username=root;password=vitcse"; MySqlConnection myconn = new MySqlConnection(myconnection); MySqlCommand SelectCommand = new MySqlCommand("select * from acc.login where name='" + this.textBox1.Text + "' and password='******';", myconn); MySqlDataReader myreader; myconn.Open(); myreader = SelectCommand.ExecuteReader(); int count = 0; while (myreader.Read()) { count = count + 1; } if (count == 1) { this.Hide(); Form3 f2 = new Form3(); f2.ShowDialog(); } else if (count > 1) { MessageBox.Show("Access denied"); } else MessageBox.Show("Incorrect"); myconn.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }
private void button2_Click(object sender, EventArgs e) { f = new Form3(pictureBox1); f.Show(); }
private void button2_Click(object sender, EventArgs e) { Form3 blackForm = new Form3(this); blackForm.Show(); }
public void Button1_Click_NoData_Form3() { Form3 f3 = new Form3(); f3.button1_Click(f3.button1, EventArgs.Empty); }
private void giris_Click(object sender, EventArgs e) { if (giris_hakki != 0) { if (radioButton1.Checked == true) { durum = true; try { baglan.Open(); string sql = "select *from kullanicilar where [Kullanıcı Adı]=@kullaniciadi and Parola=@sifre and Yetki=@yetki"; SqlParameter prm_ad = new SqlParameter("kullaniciadi", textBox1.Text.Trim()); SqlParameter prm_sifre = new SqlParameter("sifre", textBox2.Text.Trim()); SqlParameter prm_yetki = new SqlParameter("yetki", radioButton1.Text); SqlCommand komut = new SqlCommand(sql, baglan); komut.Parameters.Add(prm_ad); komut.Parameters.Add(prm_sifre); komut.Parameters.Add(prm_yetki); DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(komut); da.Fill(dt); SqlDataReader oku = komut.ExecuteReader(); while (oku.Read()) { ListViewItem ekle = new ListViewItem(); tcno = oku["TCno"].ToString(); ad = oku["Ad"].ToString(); soyad = oku["Soyad"].ToString(); yetki = oku["Yetki"].ToString(); } if (dt.Rows.Count > 0) { Form2 form2 = new Form2(); form2.Show(); this.Hide(); } komut.ExecuteNonQuery(); } catch (Exception) { MessageBox.Show("Hatalı giriş yaptınız. Lütfen tekrar kontrol ediniz.", "SKY Kontrol Takip Programı", MessageBoxButtons.OK, MessageBoxIcon.Error); } baglan.Close(); } else if (radioButton2.Checked == true) { try { baglan.Open(); string sql = "select * from kullanicilar where [Kullanıcı Adı]=@kullaniciadi and Parola=@sifre and Yetki=@yetki"; SqlParameter prm_ad = new SqlParameter("kullaniciadi", textBox1.Text.Trim()); SqlParameter prm_sifre = new SqlParameter("sifre", textBox2.Text.Trim()); SqlParameter prm_yetki = new SqlParameter("yetki", radioButton2.Text); SqlCommand komut = new SqlCommand(sql, baglan); komut.Parameters.Add(prm_ad); komut.Parameters.Add(prm_sifre); komut.Parameters.Add(prm_yetki); DataTable dt = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(komut); da.Fill(dt); if (dt.Rows.Count > 0) { Form3 form3 = new Form3(); form3.Show(); this.Hide(); } } catch (Exception) { MessageBox.Show("Hatalı giriş yaptınız. Lütfen tekrar kontrol ediniz.", "SKY Kontrol Takip Programı", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } if (durum == false) { giris_hakki--; label5.Text = Convert.ToString(giris_hakki); } if (giris_hakki == 0) { giris.Enabled = false; MessageBox.Show("3 defa hatalı giriş yaptınız için programa girişiniz engellenmiştir.", "SKY Takip Programı", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void button1_Click(object sender, EventArgs e) { Form3 frm3 = new Form3(); frm3.Show(this); }
public Form2(string name, string pay) { Form form3 = new Form3(name, pay); form3.ShowDialog(); }
private void sendToFLIRTToolStripMenuItem_Click(object sender, EventArgs e) { Form3 FForm = new Form3(); FForm.flrt = MyGNIDA.flirt; FForm.Func = GetSelectedFunction(); FForm.ShowDialog(); }
private void ������������������������������������������ToolStripMenuItem_Click(object sender, EventArgs e) { Form3 f3 = new Form3(); f3.ShowDialog(); Statistics.Columns.Clear(); Statistics.Columns.Add("NN", "� �/�"); label19.Text = "������ ����������� ������ ����������� ���������� �� ����� ����������, ������� ����������, �� " + DateTime.Now.ToShortDateString() + " :"; label18.Text = ""; //DataSet StatDS = dbw.GetDebtors(); try { Statistics.DataSource = dbw.GetDebtorsFCT(f3.StartDate, f3.EndDate);//StatDS.Tables[0]; } catch (IndexOutOfRangeException ev) { string s = ev.Message; MessageBox.Show("����������� ���!", "����������.", MessageBoxButtons.OK, MessageBoxIcon.Information); Statistics.Columns.Clear(); return; } autoinc(Statistics); Statistics.Columns[1].HeaderText = "���� ��������"; Statistics.Columns[2].HeaderText = "����� ������"; Statistics.Columns[3].HeaderText = "�������"; Statistics.Columns[3].Width = 100; Statistics.Columns[4].HeaderText = "���"; Statistics.Columns[4].Width = 90; Statistics.Columns[5].HeaderText = "��������"; Statistics.Columns[5].Width = 110; Statistics.Columns[6].HeaderText = "��������"; Statistics.Columns[6].Width = 170; Statistics.Columns[7].HeaderText = "�����"; Statistics.Columns[7].Width = 130; Statistics.Columns[8].Visible = false; Statistics.Columns[9].Visible = false; Statistics.Columns[10].Visible = false; Sorting.WhatStat = Stats.Debtors; Sorting.AuthorSort = SortDir.None; Sorting.ZagSort = SortDir.None; foreach (DataGridViewRow r in Statistics.Rows) { if (r.Cells[10].Value.ToString() == "true") { r.DefaultCellStyle.BackColor = Color.LightYellow; } } //DataGridViewColumn col = new DataGridViewColumn(); //col.HeaderText = "�/�"; //Statistics.Columns }
private void ����������������������������������������������������������������ToolStripMenuItem_Click(object sender, EventArgs e) { Form3 f3 = new Form3(); f3.ShowDialog(); Conn.SQLDA.SelectCommand.CommandText = "select IDREADER,DATE_PROLONG from Reservation_R..ISSUED " + " where DATE_PROLONG between '" + f3.StartDate.ToString("yyyyMMdd") + "' and '" + f3.EndDate.ToString("yyyyMMdd") + "' " + " group by DATE_PROLONG,IDREADER"; DataSet DS = new DataSet(); int i = Conn.SQLDA.Fill(DS, "t"); MessageBox.Show("���������� ���������, ���������� ���� ������������� ���������� �� ��������� ������, ��������� " + i.ToString(), "����������", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void �������������������������������������ToolStripMenuItem_Click(object sender, EventArgs e) { if (Statistics.Columns != null) Statistics.Columns.Clear(); Form3 f3 = new Form3(); f3.ShowDialog(); label18.Text = ""; label19.Text = ""; //label19.Text = "���������� �������� ����������, �� ������ �" + f3.StartDate.ToString("yyyyMMdd") + " �� " + f3.EndDate.ToString("yyyyMMdd") + ": "; string cntISSBOOK = dbw.GetBooksCount(f3.StartDate, f3.EndDate); MyDateSpan = new Span(); MyDateSpan.start = f3.StartDate; MyDateSpan.end = f3.EndDate; //���������� ��������� ��������� ���������� Conn.SQLDA.SelectCommand.CommandText = "select IDREADER,DATE_FACT_VOZV from Reservation_R..ISSUED " + " where DATE_FACT_VOZV between '" + f3.StartDate.ToString("yyyyMMdd") + "' and '" + f3.EndDate.ToString("yyyyMMdd") + "' " + " group by DATE_FACT_VOZV,IDREADER"; DataSet DS = new DataSet(); string cntRETRDR = Conn.SQLDA.Fill(DS, "t").ToString(); //���������� ��������� ������� ����������(������ ����������) Conn.SQLDA.SelectCommand.CommandText = "select IDREADER,DATE_ISSUE from Reservation_R..ISSUED " + " where DATE_ISSUE between '" + f3.StartDate.ToString("yyyyMMdd") + "' and '" + f3.EndDate.ToString("yyyyMMdd") + "' " + " group by DATE_ISSUE,IDREADER"; DS = new DataSet(); string cntISSRDR = Conn.SQLDA.Fill(DS, "t").ToString(); //���������� ��������� ���������� ���� ����������� ���������� Conn.SQLDA.SelectCommand.CommandText = "select IDREADER,DATE_PROLONG from Reservation_R..ISSUED " + " where DATE_PROLONG between '" + f3.StartDate.ToString("yyyyMMdd") + "' and '" + f3.EndDate.ToString("yyyyMMdd") + "' " + " group by DATE_PROLONG,IDREADER"; DS = new DataSet(); string cntPROLONGRDR = Conn.SQLDA.Fill(DS, "t").ToString(); //���������� ����������� ��������� Conn.SQLDA.SelectCommand.CommandText = "with A as ( " + "select IDREADER,DATE_ISSUE " + "from Reservation_R..ISSUED " + "where DATE_ISSUE between '" + f3.StartDate.ToString("yyyyMMdd") + "' and '" + f3.EndDate.ToString("yyyyMMdd") + "' " + "group by DATE_ISSUE,IDREADER " + "), " + "B as ( " + "select IDREADER,DATE_FACT_VOZV " + "from Reservation_R..ISSUED " + "where DATE_FACT_VOZV between '" + f3.StartDate.ToString("yyyyMMdd") + "' and '" + f3.EndDate.ToString("yyyyMMdd") + "' " + "group by DATE_FACT_VOZV,IDREADER " + "), " + "C as ( " + "select IDREADER,DATE_PROLONG " + "from Reservation_R..ISSUED " + "where DATE_PROLONG between '" + f3.StartDate.ToString("yyyyMMdd") + "' and '" + f3.EndDate.ToString("yyyyMMdd") + "' " + "group by DATE_PROLONG,IDREADER " + ") " + "select * from A " + "union " + "select * from B " + "union " + "select * from C"; DS = new DataSet(); string cntSRVRDR = Conn.SQLDA.Fill(DS, "t").ToString(); Statistics.Columns.Clear(); //Statistics.Rows.Clear(); Statistics.DataSource = null; Statistics.Columns.Add("NN", "��"); Statistics.Columns.Add("spravka", "�������"); Statistics.Columns[1].Width = 500; Statistics.Columns.Add("kolvo", "����������"); string[] row = { "1", "������ ����������", cntISSBOOK }; Statistics.Rows.Add(row); row = new string[] { "2", "���������� ��������� ��������� ����������", cntRETRDR }; Statistics.Rows.Add(row); row = new string[] { "3", "���������� ��������� ������� ���������� (������ ����������)", cntISSRDR }; Statistics.Rows.Add(row); row = new string[] { "4", "���������� ��������� ���������� ���� ����������� ���������", cntPROLONGRDR }; Statistics.Rows.Add(row); row = new string[] { "5", "���������� ����������� ���������", cntSRVRDR }; Statistics.Rows.Add(row); button12.Enabled = true; }
private void ������������������������ToolStripMenuItem_Click(object sender, EventArgs e) { Statistics.Columns.Clear(); Statistics.Columns.Add("NN", "� �/�"); Statistics.AutoSizeRowsMode = DataGridViewAutoSizeRowsMode.AllCells; Statistics.RowTemplate.DefaultCellStyle.WrapMode = System.Windows.Forms.DataGridViewTriState.True; Statistics.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; Form3 f3 = new Form3(); f3.ShowDialog(); label19.Text = "������ �������� ���������� c " + f3.StartDate.ToShortDateString() + " �� " + f3.EndDate.ToShortDateString() + " :"; label18.Text = ""; Statistics.DataSource = dbw.GetIssuedBooks(f3.StartDate, f3.EndDate); //StatDS.Tables[0]; if (this.Statistics.Rows.Count == 0) { this.Statistics.Columns.Clear(); MessageBox.Show("��� �������� ����!"); return; } autoinc(Statistics); Statistics.Columns[0].Width = 40; Statistics.Columns[1].HeaderText = "��������"; Statistics.Columns[1].Width = 280; Statistics.Columns[2].HeaderText = "�����"; Statistics.Columns[2].Width = 150; Statistics.Columns[9].Visible = false; Statistics.Columns[4].HeaderText = "��������������"; Statistics.Columns[4].Width = 150; Statistics.Columns[4].Visible = false; Statistics.Columns[5].Visible = false; Statistics.Columns[6].Visible = false; Statistics.Columns[7].HeaderText = "����� ������ ������� ������"; Statistics.Columns[7].Width = 70; Statistics.Columns[8].HeaderText = "���"; Statistics.Columns[8].Width = 100; Statistics.Columns[3].HeaderText = "���. �����"; Statistics.Columns[3].Width = 100; Statistics.Columns[10].HeaderText = "���� ������"; Statistics.Columns[10].ValueType = typeof(DateTime); Statistics.Columns[10].Width = 85; Statistics.Columns[11].HeaderText = "������ �������� ���� ��������"; Statistics.Columns[11].Width = 85; Sorting.WhatStat = Stats.IssuedBooks; Sorting.AuthorSort = SortDir.None; Sorting.ZagSort = SortDir.None; button12.Enabled = true; }
private void toolStripMenuItem5_Click(object sender, EventArgs e) { Statistics.Columns.Clear(); Form3 f3 = new Form3(); f3.ShowDialog(); //label17.Text = "���������� �������� ����������, �� ������ �" + f3.StartDate.ToString("dd.MM.yyyy") + " �� " + f3.EndDate.ToString("dd.MM.yyyy") + ": " + dbw.GetBooksCount(f3.StartDate, f3.EndDate); label19.Text = "���-�� �������� ����������, �� ������ � " + f3.StartDate.ToString("dd.MM.yyyy") + " �� " + f3.EndDate.ToString("dd.MM.yyyy") + ": "; label18.Text = dbw.GetBooksCount(f3.StartDate, f3.EndDate); }
private void toolStripMenuItem4_Click(object sender, EventArgs e) { Statistics.Columns.Clear(); Form3 f3 = new Form3(); f3.ShowDialog(); label19.Text = "���������� ���������, �� ������ �" + f3.StartDate.ToString("yyyyMMdd") + " �� " + f3.EndDate.ToString("yyyyMMdd") + ": "; label18.Text = dbw.GetReaderCount(f3.StartDate, f3.EndDate); }
private void button1_Click(object sender, EventArgs e) { Form3 form = new Form3(); form.Show(); }
// 接受磁卡信息 public void HandleCardMessage(Device.CardReader device, string cardId) { lock (this) { CardID = cardId; DbEntityTable <QC_IC_Info> hycrds = new DbEntityTable <QC_IC_Info>(); hycrds.LoadDataByWhere("CardID=@CardID and CardType=@CardType ", CardID, "CUT002"); foreach (var qcic in hycrds) { if (qcic.SampleId == 0) { yxcard = true; label3.Text = System.DateTime.Now + "扫卡成功!"; label3.ForeColor = Color.Red; } else { label3.Text = System.DateTime.Now + "该卡已经使用!"; label3.ForeColor = Color.Red; } } if (sum <= sjtnum) { label2.Text = System.DateTime.Now + "大桶样已经取够!"; label2.ForeColor = Color.Red; } // 开始放小桶样 bool isxycard = false; label4.Text = "放入位置"; DbEntityTable <QC_IC_Info> xycrds = new DbEntityTable <QC_IC_Info>(); xycrds.LoadDataByWhere("CardID=@CardID and CardType=@CardType ", CardID, "CUT001"); foreach (var qcic in xycrds) { if (qcic.SampleId > 0) { isxycard = true; } } int MIX_ID = 0; int weizhi = 0; int num = 0; if (isxycard == true) { DbEntityTable <QC_Sample_Veh> vehcrds = new DbEntityTable <QC_Sample_Veh>(); vehcrds.LoadDataByWhere("main.CardID=@CardID and main.MIX_TIME is null and main.WLLX='煤'", CardID); foreach (var veh in vehcrds) { MIX_ID = veh.Sample_Mix_ID; if (MIX_ID > 0) { DbEntityTable <QC_Sample_Mix> mixcrds = new DbEntityTable <QC_Sample_Mix>(); mixcrds.LoadDataByWhere("main.SAMPLE_MIX_ID=@SAMPLE_MIX_ID and main.WLLX='煤'", MIX_ID); foreach (var mix in mixcrds) { mix.MixCount = mix.MixCount + 1; if (mix.MixCount == mix.MixPlanCount) { mix.SampleState = SampleState.组批完成; mix.Mix_Time = System.DateTime.Now; } mix.Save(); weizhi = mix.TempID; num = mix.MixCount; } veh.Mix_Time = System.DateTime.Now; veh.Save(); } } if (weizhi > 0) { Form3 ts = new Form3(weizhi, num); ts.ShowDialog(); label4.Text = "放入位置" + weizhi + " 第" + num + "个小样"; label4.ForeColor = Color.Red; } // 更新显示信息 DbEntityTable <BC_DT_State> dtwzs = new DbEntityTable <BC_DT_State>(); dtwzs.LoadDataByWhere("WpCode='" + workpointCode + "' and SHOUTONG_TIME IS NULL and WLLX='煤'"); this.bCDTStateBindingSource.DataSource = dtwzs; } } }
private void button3_Click(object sender, EventArgs e) { Form3 mainform = new Form3(); mainform.Show(); }
private void button2_Click(object sender, EventArgs e) { Form3 f3 = new Form3(this); f3.Show(); }
void Button3Click(object sender, System.EventArgs e) { Form3 f3 = new Form3(); f3.Show(); }
public Form1() { InitializeComponent(); form3 = new Form3(); form3.Show(); }
private void button4_Click(object sender, EventArgs e) { Form3 formulario = new Form3(this); formulario.Show(); }
void btn_Click(object sender, EventArgs e) { int _ColumnIndex = dataGridView1.CurrentCell.ColumnIndex; int _RowIndex = dataGridView1.CurrentCell.RowIndex; DataGridViewColumn _column = dataGridView1.Columns[_ColumnIndex]; BindingSource _bdSource = new BindingSource(); _bdSource = dataGridView1.DataSource as BindingSource; if (_column.DataPropertyName == "Warehouse_Id") { string _columns = " ID=Warehouse_Id,Desc_01=Desc_01 "; string _id = ""; if (LoginInfo._ZT_Admin_Id == "Z") { _id = CommomHelper.GetQuery("Warehouse", _columns, ""); } else { string _where = "and Warehouse.Company_Id='" + LoginInfo._Usr_Company + "' And (Status_Id In ('130', '130')) And Is_Lowest='T'"; _id = CommomHelper.GetQuery("Warehouse", _columns, _where); } this.dataGridView1.Rows[_RowIndex].Cells[_ColumnIndex].Value = _id; _bdSource.EndEdit(); } else if (_column.DataPropertyName == "Item_Id") { string _columns = " ID=Item_Id,Desc_01=Desc_01 "; string _where = "and Item.Company_Id='" + LoginInfo._Usr_Company + "' And (Status_Id In ('130', '130')) And Is_Lowest='T'"; string _id = CommomHelper.GetQuery("Item", _columns, _where); this.dataGridView1.Rows[_RowIndex].Cells[_ColumnIndex].Value = _id; _bdSource.EndEdit(); } else if (_column.DataPropertyName == "ItemUnit_Id") { string _columns = " ID=ItemUnit_Id,Desc_01=ItemUnit_Id "; // string _where = " And (Status_Id In ('130', '130')) "; string _id = CommomHelper.GetQuery("ItemUnit", _columns, ""); this.dataGridView1.Rows[_RowIndex].Cells[_ColumnIndex].Value = _id; _bdSource.EndEdit(); } else if (_column.DataPropertyName == "Project_Id") { string _columns = " ID=Project_Id,Desc_01=Desc_01 "; string _where = "and Company_Id='" + LoginInfo._Usr_Company + "' And (Status_Id In ('130', '130')) "; string _id = CommomHelper.GetQuery("Project", _columns, _where); this.dataGridView1.Rows[_RowIndex].Cells[_ColumnIndex].Value = _id; _bdSource.EndEdit(); } else if (_column.DataPropertyName == "PackageMethod_Id") { string _where = "and (Status_Id In (''130'', ''130'')) "; string _columns = " ID=PackageMethod_Id,Desc_01=Desc_01 "; string _id = CommomHelper.GetQuery("PackageMethod", _columns, _where); this.dataGridView1.Rows[_RowIndex].Cells[_ColumnIndex].Value = _id; _bdSource.EndEdit(); } else if (_column.DataPropertyName == "Ewm_Id") //序列号和二维码 { if (!string.IsNullOrEmpty(this.CsvPo_Id.Text) && !string.IsNullOrEmpty(this.dataGridView1.Rows[_RowIndex].Cells["ItemPrpty_Id"].Value.ToString())) { ShippingInfoEwmManage _EwmManage = new ShippingInfoEwmManage(); _EwmManage.Edit = _Edit; _EwmManage.Shipping_Id = this.Shipping_Id.Text; _EwmManage.Company_Id = LoginInfo._Usr_Company; _EwmManage.CsvPo_Id = this.CsvPo_Id.Text; _EwmManage.ItemPrpty_Id = this.dataGridView1.Rows[_RowIndex].Cells["ItemPrpty_Id"].Value.ToString(); _EwmManage.qty = this.dataGridView1.Rows[_RowIndex].Cells["Qty"].Value.ToString(); _EwmManage.itemUt = String.IsNullOrEmpty(this.dataGridView1.Rows[_RowIndex].Cells["ItemUnit_Id"].Value.ToString()) ? "" : this.dataGridView1.Rows[_RowIndex].Cells["ItemUnit_Id"].Value.ToString(); _EwmManage.Body1_Tbl_Name = Body1_Tbl_Name; if (_EwmManage.ShowDialog() != DialogResult.OK) { } } else { MessageBox.Show("客户PO和型号必须输入!"); } } else if (_column.DataPropertyName == "snc") //SNC导入导出 { if (string.IsNullOrEmpty(this.CsvPo_Id.Text) || string.IsNullOrEmpty(this.dataGridView1.Rows[_RowIndex].Cells["ItemPrpty_Id"].Value.ToString()) || string.IsNullOrEmpty(this.dataGridView1.Rows[_RowIndex].Cells["Qty"].Value.ToString())) { MessageBox.Show("客户PO和型号、数量必须输入!"); return; } Form3 f3 = new Form3(); f3.PO = this.CsvPo_Id.Text; f3.SEL = this.dataGridView1.Rows[_RowIndex].Cells["ItemPrpty_Id"].Value.ToString(); f3.QTY = this.dataGridView1.Rows[_RowIndex].Cells["Qty"].Value.ToString(); f3.input = this.dataGridView1.Rows[_RowIndex].Cells["Src_Input_Id"].Value.ToString(); if (f3.ShowDialog() != DialogResult.OK) { } } }
public void Form3ButtonClick() // Assume this happens in a button click event on MainWindow. { this.thirdForm = new Form3(); this.thirdForm.PropertyChanged += this.LatestValueChanged; this.thirdForm.Closing += this.ChildWindowClosing; }
void frm3_FormClosed(object sender, FormClosedEventArgs e) { frm3 = null; Show(); }
private void button_Click_Exit(object sender, System.EventArgs e) { Form3 frm = new Form3(); frm.ShowDialog(); }
private void Trojka_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e) { Form3 zasady = (Form3)this.MdiParent; zasady.PanelZasad.Visible = true; }
public Form2(MyDelegate del = null) { form2Delegate = del; var form3 = new Form3(form2Delegate); }
private void buttonAll_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) { if (e.Button == MouseButtons.Right && tagnum < 10 && bjbt[((Button)sender).TabIndex] == 0) //是否右击,并且是否已标记 { tagnum++; bjbt[((Button)sender).TabIndex] = 1; label1.Text = "已标记" + tagnum.ToString() + "个地雷"; ((Button)sender).BackgroundImage = imageList1.Images[9]; if (b[((Button)sender).TabIndex] == 1) //如果标记的地方正好是地雷 { win1++; } if (win1 == 10) //第一种胜利条件 { Form frm2 = new Form2(); timer1.Stop(); frm2.ShowDialog(); buttonrefresh(); } } else if (e.Button == MouseButtons.Right && bjbt[((Button)sender).TabIndex] == 1) //若已标记则撤销标记 { tagnum--; bjbt[((Button)sender).TabIndex] = 0; label1.Text = "已标记" + tagnum.ToString() + "个地雷"; ((Button)sender).BackgroundImage = null; if (b[((Button)sender).TabIndex] == 1) //如果标记的地方正好是地雷,第一种胜利条件值减1 { win1--; } } else if (e.Button == MouseButtons.Left && bjbt[((Button)sender).TabIndex] != 1) //是否左击 { bjbt[((Button)sender).TabIndex] = 2; if (b[((Button)sender).TabIndex] == 0) //如果这里没有地雷 { surnum = surround(((Button)sender).TabIndex); //统计地雷数 if (surnum == 0) //如果周围没有地雷 { showthenull(((Button)sender).TabIndex); } else { ((Button)sender).BackgroundImage = imageList1.Images[surnum]; //显示地雷数 } } else { ((Button)sender).BackgroundImage = imageList1.Images[0]; //显示地雷 Form frm3 = new Form3(); //失败 timer1.Stop(); frm3.ShowDialog(); buttonrefresh(); } } }
private void button2_Click(object sender, EventArgs e) { Form3 telaCadastro = new Form3(); telaCadastro.ShowDialog(); }
private void btnBattleListForm_Click(object sender, EventArgs e) { Form3 frm3 = new Form3(); frm3.ShowDialog(this); }
private void InfoVentas(object sender, RoutedEventArgs e) { Form3 RV = new Form3(); RV.ShowDialog(); }