if statement

+1 Just Noob · January 27, 2015
I've got a problem now . I'm learning now from tutorials and when i write :
        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "yes")
            {
                MessageBox.Show = "You are right!";
            }

    }
I'm using virtual studio 2013 so it says "cannot assign to "show" because it is a 'method group'"

what shloud i do ?

Post a Reply

Replies

Oldest  Newest  Rating
+1 Branislav Lazic · January 27, 2015
"Show" is not a property within MessageBox class. "Show" is a static method that takes your message as an argument.

Correct use:


MessageBox.Show("You are right!");
0 Just Noob · January 28, 2015
Thank you! you saved me :D 
  • 1

C#

107,055 followers
About

C# is an object-oriented language designed for improving the development of web applications.

Links
Moderators