AalborgHTX

To forme

Apr 5th, 2019 (edited)
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. public partial class Form1 : Form
  2. {
  3. Form2 Reftilandetvindue;
  4. public TextBox Textbox1 = new TextBox();
  5.  
  6. public Form1()
  7. {
  8. InitializeComponent();
  9. }
  10.  
  11. private void btnForm1_Click(object sender, EventArgs e)
  12. {
  13. Reftilandetvindue.Textbox2.Text = Reftilandetvindue.Textbox2.Text + "X";
  14. }
  15.  
  16. private void Form1_Load(object sender, EventArgs e)
  17. {
  18. Reftilandetvindue = new Form2(this);
  19. Reftilandetvindue.Show();
  20. Textbox1 = txtForm1;
  21. }
  22. }
  23.  
  24. public partial class Form2 : Form
  25. {
  26. Form1 RefTilForm1;
  27. public TextBox Textbox2;
  28.  
  29. public Form2(Form1 ReferenceTilKaldendeObjekt)
  30. {
  31. InitializeComponent();
  32. RefTilForm1 = ReferenceTilKaldendeObjekt;
  33. }
  34.  
  35. private void btnForm2_Click(object sender, EventArgs e)
  36. {
  37. RefTilForm1.Textbox1.Text = RefTilForm1.Textbox1.Text + "X";
  38. }
  39.  
  40. private void Form2_Load(object sender, EventArgs e)
  41. {
  42. Textbox2 = txtForm2;
  43. }
  44. }
Add Comment
Please, Sign In to add comment