Instead of using events, which is the normal way, you can also simply put your count variable in
Program as a
Static
variable.
Then your can simply refer to it as:
Program.count
in your forms, example:
using System;
using System.Windows.Forms;
namespace QueuingSystem
{
static class Program
{
public static int count = 123;
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
}
And in your Form:
using System.Windows.Forms;
namespace QueuingSystem
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.Text = Program.count.ToString();
}
}
}