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 WindowsFormsApplication2 { public public { public Form1() { InitializeComponent(); Form2 f2 = new f2.ShowCounter = new f2.Show(); } public { this.Text = counter.ToString(); } } } 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 WindowsFormsApplication2 { public { public Form2() { InitializeComponent(); } public int counter=0; private { counter++; ShowCounter?.Invoke(counter); } } } |