.NET

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

Error message dialog box

211 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

Probably PresentationFramework.dll (and PresentationCore.dll)

 

Clipboard-1.png

Mentor
SENL1362
Posts: 213
Registered: ‎07-20-2011
Message 2 of 5 (190 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 (186 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: 213
Registered: ‎07-20-2011
Message 4 of 5 (180 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 (173 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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!