Results 1 to 2 of 2

Thread: error

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Dec 2002
    Location
    London
    Posts
    678

    error

    Hi Guys,
    I am trying to run my first C# program. Placed a button on the windows form.
    Here is the code for the button
    private void button1_Click(object sender, System.EventArgs e)
    {
    messagebox.show("Hello there!");
    }

    But as the program is run The error is: The type or namespace name 'messagebox' could not be found (are you missing a using directive or an assembly reference?)

    Any thoughts pls?
    Thanks

  2. #2
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    C# is case-sensitive, therfore, messagebox does not exist in any of the reference assemblies. Use this:

    Code:
        MessageBox.Show("Hello World");
    Have fun.

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