Click to See Complete Forum and Search --> : [RESOLVED] What does this warning mean?


Pale
August 10th, 2008, 02:51 PM
What does this warning mean? And how can i fix it?

Warning 1 'MY_Namspace.MainForm.Load()' hides inherited member 'System.Windows.Forms.Form.Load'. Use the new keyword if hiding was intended.

This is my load method:
private void Load()
{
settings.LoadXml();
txtDisplay.Text = settings.Display;
txtName.Text = settings.Name;
txtTopic.Text = settings.Topic;

settings.LoadTo(txtTo.Text);
settings.LoadBody(txtBody.Text);
}

Thanks.

Pale
August 10th, 2008, 03:41 PM
Never mind i figured out why. Apparently i cant use the name load.

Arjay
August 10th, 2008, 03:47 PM
Never mind i figured out why. Apparently i cant use the name load.You can if you want to replace the inherited Load method. If you do declare it as:

private new void Load()

In your case, perhaps LoadSettings( ) will be more appropriate?