Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public partial class Form1 : Form
- {
- Form2 Reftilandetvindue;
- public TextBox Textbox1 = new TextBox();
- public Form1()
- {
- InitializeComponent();
- }
- private void btnForm1_Click(object sender, EventArgs e)
- {
- Reftilandetvindue.Textbox2.Text = Reftilandetvindue.Textbox2.Text + "X";
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- Reftilandetvindue = new Form2(this);
- Reftilandetvindue.Show();
- Textbox1 = txtForm1;
- }
- }
- public partial class Form2 : Form
- {
- Form1 RefTilForm1;
- public TextBox Textbox2;
- public Form2(Form1 ReferenceTilKaldendeObjekt)
- {
- InitializeComponent();
- RefTilForm1 = ReferenceTilKaldendeObjekt;
- }
- private void btnForm2_Click(object sender, EventArgs e)
- {
- RefTilForm1.Textbox1.Text = RefTilForm1.Textbox1.Text + "X";
- }
- private void Form2_Load(object sender, EventArgs e)
- {
- Textbox2 = txtForm2;
- }
- }
Add Comment
Please, Sign In to add comment