CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2008
    Posts
    161

    [RESOLVED] What does this warning mean?

    What does this warning mean? And how can i fix it?

    Code:
    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:
    Code:
    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.
    Last edited by Pale; August 10th, 2008 at 06:08 PM.

  2. #2
    Join Date
    Mar 2008
    Posts
    161

    Re: What does this warning mean?

    Never mind i figured out why. Apparently i cant use the name load.

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: What does this warning mean?

    Quote Originally Posted by Pale
    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:

    Code:
    private new void Load()
    In your case, perhaps LoadSettings( ) will be more appropriate?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured