Hi, I am a very new C# programmer and I am trying to make a kiosk application more accessible by increasing the size of fonts. No problem on the main form. I'm having a problem replacing messageboxes (for which I believe there is no way to increase the font size) with small forms with the same message.
This is where I'm running into the problem. The main form can't "see" the error form and its label to set the text. I have tried setting a property for the private label on the error form, but it's still not working.
I would be very grateful for any assistance. I have been trying to apply what I've learned in reading several threads from various C# sources.
Two strange things I have noticed but am so new to C# that I don't know what they may indicate: (1) In the MainForm when I type ErrorForm. the Intellisense list of suggested code pops up but the variable LblNotCheckedInBecause does not appear on the list. (2) The compiler error says something about the LBlNotCheckedInBecause.get statement and it seems like to me it should be refering to the set statement since I'm trying to set that value.
Here are the parts of the code that I believe are involved and if any additional code is needed, just let me know:
From the bottom of ErrorForm.Designer.cs...
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label lblNotCheckedInBecause;
public string LblNotCheckedInBecause // property I created to try to be able
// to change the label
{
get { return this.lblNotCheckedInBecause.Text; }
set { this.lblNotCheckedInBecause.Text = value; }
From MainForm.cs... MessageBox.Show("You were not checked in because of the following reasons:" + sErrors); // this is what I'm trying to replace ErrorForm.LblNotCheckInBecause = "You were not checked in because of the following reasons:" + sErrors; // this line is causing a compiler error
Compiler error... Error 1 An object reference is required for the nonstatic field, method, or property 'LogisticsKiosk.ErrorForm.LblNotCheckInBecause.get' C:\Documents and Settings\My Documents\Visual Studio 2005\Projects\LogisticsKiosk\Forms\MainForm.cs 107 17 LogisticsKiosk