.NET

Reply
Valued Contributor
Posts: 77
Registered: ‎05-03-2013
Message 1 of 5 (128 Views)
Accepted Solution

Error message dialog box

128 Views, 4 Replies
12-27-2013 12:48 AM

I know the general message dialog box, I can achieve by the following code


    Application.ShowAlertDialog (Message);

 

But I want to use the error message dialog box, there is a small red cross in the dialog box, is there anyone know which class is it?

 

Thanks very much

Distinguished Contributor
SENL1362
Posts: 138
Registered: ‎07-20-2011
Message 2 of 5 (107 Views)

Re: Error message dialog box

12-27-2013 03:31 AM in reply to: HelloWorlddd
MessageBox.Show("MessageToShow","Title",MessageBoxButton.OKCancel,MessageBoxImage.Error)
Valued Contributor
Posts: 77
Registered: ‎05-03-2013
Message 3 of 5 (103 Views)

Re: Error message dialog box

12-27-2013 04:27 AM in reply to: SENL1362

uh.I just use C#, and program for AutoCAD

the System is't include the Windows...

Is that mean I need reference some dll?

Distinguished Contributor
SENL1362
Posts: 138
Registered: ‎07-20-2011
Message 4 of 5 (97 Views)

Re: Error message dialog box

12-27-2013 04:37 AM in reply to: HelloWorlddd

Probably PresentationFramework.dll (and PresentationCore.dll)

 

Clipboard-1.png

Valued Contributor
Posts: 77
Registered: ‎05-03-2013
Message 5 of 5 (90 Views)

Re: Error message dialog box

12-27-2013 05:54 AM in reply to: SENL1362

It's need to reference System.Windows.Forms.dll

Then using System.Windows.Froms namespace

Last, write the following code.

MessageBox.Show("hello", "Caption...",MessageBoxButtons.OK,MessageBoxIcon.Error);

 

Very thanks.

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community