private void btn_printForm_Click(object sender, EventArgs e) { //Form1 f1 = new Form1(); Print pr = new Print(); //f1.Hide(); this.Hide(); pr.setUserCode = ID.ToString(); pr.setName = tb_t1_name.Text; pr.setSurname = tb_t1_surname.Text; pr.setMail = tb_t1_mail.Text; pr.setPhone = tb_t1_phone.Text; pr.setBirthdate = dateTimePicker1.Value.ToString("dd.MM.yyyy"); pr.setActivationCode = tb_t1_activationCode.Text; pr.setDateFrom = dtp_t1_dateFrom.Value.ToString("dd.MM.yyyy"); pr.setDateTo = (dtp_t1_dateFrom.Value.AddMonths(1)).ToString("dd.MM.yyyy"); pr.Show(); //this.Close(); //f1.Close(); //empty ID ID = -1; tb_t1_name.Text = ""; tb_t1_surname.Text = ""; tb_t1_mail.Text = ""; pb_t1_photo.Image = Properties.Resources.slika; tb_t1_phone.Text = ""; tb_t1_activationCode.Text = ""; dateTimePicker1.Value = DateTime.Today; dtp_t1_dateFrom.Value = DateTime.Today; }
// methode lancée par le thread private void Decor() { Print z = new Print(ChangeFond); // On instantie le délégate ??????????????????????????????????????????????????????? while (!stop) // permet de stoper le thread { Image decor = Image.FromFile(@".\decor1.png"); // on alterne les deux images de fond. On aurait pu en mettre plus. Malheureusement c'est ça qui fait perdre les performances. try { Invoke(z, decor); } // On invoque la demande au panel pour changer le fond ??????????????????????????????????? catch { } Thread.Sleep(500); decor = Image.FromFile(@".\decor2.png"); try { Invoke(z, decor); } catch { } Thread.Sleep(500); } }
private void btn_t3_print_Click(object sender, EventArgs e) { Print pr = new Print(); this.Hide(); pr.setUserCode = dgv_users.SelectedRows[0].Cells[0].Value.ToString(); pr.setName = tb_t3_name.Text; pr.setSurname = tb_t3_surname.Text; pr.setMail = tb_t3_mail.Text; pr.setPhone = tb_t3_phone.Text; pr.setBirthdate = dtp_t3_birthdate.Value.ToString("dd.MM.yyyy"); pr.setActivationCode = tb_t3_activationCode.Text; pr.setDateFrom = dtp_t3_dateFrom.Value.ToString("dd.MM.yyyy"); pr.setDateTo = (dtp_t3_dateFrom.Value.AddMonths(1)).ToString("dd.MM.yyyy"); pr.Show(); //ID = -1; //tb_t3_name.Text = ""; //tb_t3_surname.Text = ""; //tb_t3_mail.Text = ""; //pb_t3_photo.Image = Properties.Resources.slika; //tb_t3_phone.Text = ""; //tb_t3_activationCode.Text = ""; //dtp_t3_birthdate.Value = DateTime.Today; //dtp_t3_dateFrom.Value = DateTime.Today; btn_t3_print.Enabled = false; btn_t3_print.Visible = false; }
//打印 private void button3_Click(object sender, EventArgs e) { Print p = new Print(serialNum); p.Show(); }