namespace WindowsApplication1{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } public static void Count() { Form1 frm; frm = new Form1(); for (int count = 1; count <= 5; count++) { //frm.label1.Text = count.ToString(); frm.label1.Text = "something"; } } private void Form1_Load(object sender, EventArgs e) { Count(); }}
namespace WindowsApplication1{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } public static void Count() { Form1 frm; frm = new Form1(); for (int count = 1; count <= 5; count++) { //frm.Lbl = count.ToString(); frm.Lbl = "something"; } } public string Lbl { get { return label1.Text; } set { label1.Text = value; } } private void Form1_Load(object sender, EventArgs e) { Count(); }}