.NET

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

Error message dialog box

185 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

Mentor
SENL1362
Posts: 167
Registered: ‎07-20-2011
Message 2 of 5 (164 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
HelloWorlddd
Posts: 87
Registered: ‎05-03-2013
Message 3 of 5 (160 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?

Mentor
SENL1362
Posts: 167
Registered: ‎07-20-2011
Message 4 of 5 (154 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
HelloWorlddd
Posts: 87
Registered: ‎05-03-2013
Message 5 of 5 (147 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.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.