Self Taught here so please bear with me.
I have the labelRestrictSi tes as private on the MainForm.cs. I then access
the labelRestrictSi tes.Text thru the public string LabelRestrictSi tes. So
when I add your code to my class I can not access the labelRestrictSi tes
because it is private. How would I refresh?
*************** *************** **********
mainform.cs
private System.Windows. Forms.Label labelRestrictSi tes;
public string LabelRestrictSi tes
{
get { return labelRestrictSi tes.Text; }
set { labelRestrictSi tes.Text = value; }
}//end property
*************** *************** **************
RestircedSites. cs
private void AddRestrictedSi tes()
{
foreach(string x in strResSitesList )
{
MainForm frm = (MainForm)MainF orm.ActiveForm;
frm.LabelRestri ctSites = ((iTotal += 1).ToString());
}
}
*************** *************** *************** *
"TomB" <sh*****@hotmai lXXX.com> wrote in message
news:uj******** *****@TK2MSFTNG P11.phx.gbl...
Try refreshing the control.
frm.LabelRestri ctSites = ((iTotal += 1).ToString());
frm.LabelRestri ctSites.Refresh ();
"Yogi_Bear_ 79" <IT*****@spamfr ee.com> wrote in message
news:ep******** ************@co mcast.com... I have a for each loop, that currently runs through an array of 11,000+
items. I exerpted the code part below that I have a question on. I
thought this code would update the form label and increment it by one each time
the code passed to the next element in the array. Maybe it just goes to
fast, but it goes from zero (default) to thte final number in what appears to
be one motion.
private void AddRestrictedSi tes()
{
foreach(string x in strResSitesList )
{
MainForm frm = (MainForm)MainF orm.ActiveForm;
frm.LabelRestri ctSites = ((iTotal += 1).ToString());
}
}