Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApp42
- {
- public partial class Form1 : Form
- {
- Form2 RefTilForm2;
- public Form1()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- RefTilForm2 = new Form2(this);
- RefTilForm2.Show();
- }
- private void btnKnap1_Click(object sender, EventArgs e)
- {
- RefTilForm2.OpdaterForm2();
- }
- public void OpdaterForm1()
- {
- lblForm1.Text = lblForm1.Text + "X";
- }
- }
- }
- ---------------------------------------------------------------------
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace WindowsFormsApp42
- {
- public partial class Form2 : Form
- {
- Form1 RefTilForm1;
- public Form2(Form1 KaldendeObjekt)
- {
- InitializeComponent();
- RefTilForm1 = KaldendeObjekt;
- }
- public void OpdaterForm2()
- {
- lblForm2.Text = lblForm2.Text + "X";
- }
- private void btnKnap2_Click(object sender, EventArgs e)
- {
- RefTilForm1.OpdaterForm1();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement