Guest User

Untitled

a guest
Jul 21st, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. private void dataGridView1_CellDoubleClick(object sender, DataGridViewCellEventArgs e)
  2. {
  3. int currentRow = int.Parse(e.RowIndex.ToString());
  4.  
  5. Form3 f3 = null;
  6. TextBox t = null;
  7. if ((f3 = (Form3)IsFormAlreadyOpen(typeof(Form3))) == null)
  8. {
  9. f3 = new Form3();
  10. DataGridView dt = (DataGridView)f3.Controls["dataGridView2"];
  11.  
  12. string aa = dataGridView1[1, currentRow].Value.ToString();
  13.  
  14.  
  15. dt.Rows.Add(aa, "0");
  16.  
  17.  
  18. f3.Show();
  19. f3.Controls["T_Material"].Text = "";
  20. this.Close();
  21. }
  22. else
  23. {
  24. f3.Select();
  25. DataGridView dt = (DataGridView)f3.Controls["dataGridView2"];
  26.  
  27. string aa = dataGridView1[1, currentRow].Value.ToString();
  28.  
  29.  
  30. dt.Rows.Add(aa, "0");
  31. f3.Controls["T_Material"].Text = "";
  32. this.Close();
  33.  
  34. }
  35. }
  36.  
  37.  
  38.  
  39. private void textBox7_TextChanged(object sender, EventArgs e)
  40. {
  41. Form1 f1 = null;
  42. if ((f1 = (Form1)IsFormAlreadyOpen(typeof(Form1))) == null)
  43. {
  44. f1 = new Form1();
  45. f1.Show();
  46.  
  47. }
  48. else
  49. {
  50. f1.Select();
  51. }
  52.  
  53. }
Add Comment
Please, Sign In to add comment