Self Taught here so please bear with me.
I have the labelRestrictSites as private on the MainForm.cs. I then access
the labelRestrictSites.Text thru the public string LabelRestrictSites from
another class. So
when I add labelRestrictSites.refresh code to my class I get an error
because the labelRestrictSites
is private. How would I refresh?
****************************************
mainform.cs
private System.Windows.Forms.Label labelRestrictSites;
public string LabelRestrictSites
{
get { return labelRestrictSites.Text; }
set { labelRestrictSites.Text = value; }
}//end property
********************************************
RestircedSites.cs
private void AddRestrictedSites()
{
foreach(string x in strResSitesList)
{
MainForm frm = (MainForm)MainForm.ActiveForm;
frm.LabelRestrictSites = ((iTotal += 1).ToString());
}
} 4 8221
Yogi_Bear_79,
Can you show the call to refresh? It's not in the sample code that you
posted. Also, what is the error that you are getting? It sounds like a
compile time error, but without seeing the code or the error, it's hard to
provide any insight.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Yogi_Bear_79" <IT*****@spamfree.com> wrote in message
news:ad********************@comcast.com... Self Taught here so please bear with me.
I have the labelRestrictSites as private on the MainForm.cs. I then access the labelRestrictSites.Text thru the public string LabelRestrictSites from another class. So when I add labelRestrictSites.refresh code to my class I get an error because the labelRestrictSites is private. How would I refresh?
**************************************** mainform.cs private System.Windows.Forms.Label labelRestrictSites;
public string LabelRestrictSites
{
get { return labelRestrictSites.Text; }
set { labelRestrictSites.Text = value; }
}//end property
******************************************** RestircedSites.cs private void AddRestrictedSites() { foreach(string x in strResSitesList) { MainForm frm = (MainForm)MainForm.ActiveForm;
frm.LabelRestrictSites = ((iTotal += 1).ToString()); } }
I added the line of code in line below. The compile time error is:
MainForm.labeRestrictedSites is inaccessible due to it's protection level
Which I think I understand. That's why I have a public string to access the
text of this label. But I don't know/understand how to access the refresh
feature now
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl... Yogi_Bear_79,
Can you show the call to refresh? It's not in the sample code that
you posted. Also, what is the error that you are getting? It sounds like a compile time error, but without seeing the code or the error, it's hard to provide any insight.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Yogi_Bear_79" <IT*****@spamfree.com> wrote in message news:ad********************@comcast.com... Self Taught here so please bear with me.
I have the labelRestrictSites as private on the MainForm.cs. I then
access the labelRestrictSites.Text thru the public string LabelRestrictSites
from another class. So when I add labelRestrictSites.refresh code to my class I get an error because the labelRestrictSites is private. How would I refresh?
**************************************** mainform.cs private System.Windows.Forms.Label labelRestrictSites;
public string LabelRestrictSites
{
get { return labelRestrictSites.Text; }
set { labelRestrictSites.Text = value; }
}//end property
******************************************** RestircedSites.cs private void AddRestrictedSites() { foreach(string x in strResSitesList) { MainForm frm = (MainForm)MainForm.ActiveForm;
frm.LabelRestrictSites = ((iTotal += 1).ToString()); frm.LabelRestrictSites.Refresh(); } }
Yogi_Bear_79,
So if I understand correctly, you want to invoke a refresh from outside
of the class that is hosting the control. In this case, you would have to
expose either the control itself, and call Refresh on that, or create a
method that will call Refresh on the control for you.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Yogi_Bear_79" <IT*****@spamfree.com> wrote in message
news:s9********************@comcast.com... I added the line of code in line below. The compile time error is:
MainForm.labeRestrictedSites is inaccessible due to it's protection level
Which I think I understand. That's why I have a public string to access the text of this label. But I don't know/understand how to access the refresh feature now
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... Yogi_Bear_79,
Can you show the call to refresh? It's not in the sample code that you posted. Also, what is the error that you are getting? It sounds like a compile time error, but without seeing the code or the error, it's hard to provide any insight.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Yogi_Bear_79" <IT*****@spamfree.com> wrote in message news:ad********************@comcast.com... > Self Taught here so please bear with me. > > I have the labelRestrictSites as private on the MainForm.cs. I then access > the labelRestrictSites.Text thru the public string LabelRestrictSites from > another class. So > when I add labelRestrictSites.refresh code to my class I get an error > because the labelRestrictSites > is private. How would I refresh? > > **************************************** > mainform.cs > private System.Windows.Forms.Label labelRestrictSites; > > public string LabelRestrictSites > > { > > get { return labelRestrictSites.Text; } > > set { labelRestrictSites.Text = value; } > > }//end property > > ******************************************** > RestircedSites.cs > private void AddRestrictedSites() > { > foreach(string x in strResSitesList) > { > MainForm frm = (MainForm)MainForm.ActiveForm; > > frm.LabelRestrictSites = ((iTotal += 1).ToString()); frm.LabelRestrictSites.Refresh(); > } > } > > >
Nicholas,
Yes this started because as my code updates the labels text value, it
doesn't appear to go up on the form. Meaning it goes from default of Zero,
to the end number in what appears to be an instant. The thinking was if we
invoked a refresh after every loop we could see the number grow. If I
understand you, I can create a method on the form class itself, then call
that method from my other class.
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ey**************@TK2MSFTNGP09.phx.gbl... Yogi_Bear_79,
So if I understand correctly, you want to invoke a refresh from
outside of the class that is hosting the control. In this case, you would have to expose either the control itself, and call Refresh on that, or create a method that will call Refresh on the control for you.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Yogi_Bear_79" <IT*****@spamfree.com> wrote in message news:s9********************@comcast.com...I added the line of code in line below. The compile time error is:
MainForm.labeRestrictedSites is inaccessible due to it's protection
level Which I think I understand. That's why I have a public string to access the text of this label. But I don't know/understand how to access the
refresh feature now
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:%2****************@TK2MSFTNGP09.phx.gbl... Yogi_Bear_79,
Can you show the call to refresh? It's not in the sample code that you posted. Also, what is the error that you are getting? It sounds like
a compile time error, but without seeing the code or the error, it's hard to provide any insight.
-- - Nicholas Paldino [.NET/C# MVP] - mv*@spam.guard.caspershouse.com
"Yogi_Bear_79" <IT*****@spamfree.com> wrote in message news:ad********************@comcast.com... > Self Taught here so please bear with me. > > I have the labelRestrictSites as private on the MainForm.cs. I then access > the labelRestrictSites.Text thru the public string LabelRestrictSites from > another class. So > when I add labelRestrictSites.refresh code to my class I get an error > because the labelRestrictSites > is private. How would I refresh? > > **************************************** > mainform.cs > private System.Windows.Forms.Label labelRestrictSites; > > public string LabelRestrictSites > > { > > get { return labelRestrictSites.Text; } > > set { labelRestrictSites.Text = value; } > > }//end property > > ******************************************** > RestircedSites.cs > private void AddRestrictedSites() > { > foreach(string x in strResSitesList) > { > MainForm frm = (MainForm)MainForm.ActiveForm; > > frm.LabelRestrictSites = ((iTotal += 1).ToString()); frm.LabelRestrictSites.Refresh(); > } > } > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Ed Willis |
last post by:
If I am processing through a loop in my code and I want to update a row
count on the window, how can I make the window refresh and show the label
etc. updating?
Thanks.
|
by: Ned Balzer |
last post by:
Hi,
Apologies if this is a newbie question, I haven't found the answer in
any faqs.
I have an asp.net 2.0 page that sets session variables and then
redirects to another page. For the page...
|
by: KenMacksey |
last post by:
Hi
I am running VB6 on a pentium 4 and Win XP pro.
I wrote a small program to copy files to a memory card or mp3 player etc in a specific order or a random order instead of the windows default...
|
by: AKHTAR ALI |
last post by:
Dear Sir,
i am reading a text file line by line from vb and insert in oracle table through pl/sql procedure.
in text file record is 70000, in my code i make a loop to read data in loop and...
|
by: =?Utf-8?B?YmJkb2J1ZGR5?= |
last post by:
I have a couple of questions, these are problems that I have experienced with
IE 6
1. I have a label on a form, and sometimes when the form refreshes the
label doesn't appear on the screen,...
|
by: zombie212 |
last post by:
I have devoloped a page in asp.net with datagrid with code behind in VB, to show the result of SP_ who2 ( SQL Server System stored proc). Now I have also added a refresh button to update the page,...
|
by: Mike |
last post by:
Is there a way to determine if a page was refreshed? I have a function that
is called when the page loads, but when the user refreshes the page it calls
the function again. Is there a way to call...
|
by: =?Utf-8?B?cm9kY2hhcg==?= |
last post by:
hi all,
i betcha here's a question never asked before ;)
i have a simple web form with a gridview and a button. the button doesn't do
anything but a postback.
i load up the gridview from the...
|
by: c0elh0 |
last post by:
Hello all, I'm new to this forum and to c# too, so there are some technical questions I'm not familiar to in c#.
I'm building a program based on a FORM controled by another pc (like a server) with...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
| |