CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2007
    Posts
    20

    MessageBox method

    I using Visual C++ express edition 2005, when i click a button, it will shown a messagebox. I can write a simple code to show it, but it don hav error message, warning message, or information message.

    This is my simple code:

    Code:
    private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
    	System::Windows::Forms::MessageBox::Show("Example", "YA");
    }
    Any body can help me to change the code to show the error message or warning message???

  2. #2
    Join Date
    May 2006
    Location
    Norway
    Posts
    1,709

  3. #3
    Join Date
    Jul 2007
    Posts
    17

    Lightbulb Re: MessageBox method

    You can use the AfxMessageBox("Message"); in case of Visual c++6.0

  4. #4
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: MessageBox method

    [ moved thread ]
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  5. #5
    Join Date
    Aug 2002
    Location
    Kerala
    Posts
    1,183

    Re: MessageBox method

    Quote Originally Posted by CooLWong
    .. it will shown a messagebox. I can write a simple code to show it, but it don hav error message, warning message, or information message. ...
    Is this what you require ?

    MessageBox::Show("hello" , "test" , MessageBoxButtons::AbortRetryIgnore,
    MessageBoxIcon::Error);
    MessageBox::Show("hello" , "test" , MessageBoxButtons::AbortRetryIgnore,
    MessageBoxIcon::Information);

  6. #6
    Join Date
    Jul 2007
    Posts
    20

    Re: MessageBox method

    Quote Originally Posted by Sahir
    Is this what you require ?

    yaya... i can work wif the sample code. Thanks.

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