.NET

Reply
Valued Contributor
87 Posts
0 Kudos
Registered: ‎05-03-2013
Post 1 of 5
Accepted Solution

Error message dialog box

218 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
248 Posts
44 Kudos
Registered: ‎07-20-2011
Post 2 of 5

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
87 Posts
0 Kudos
Registered: ‎05-03-2013
Post 3 of 5

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
248 Posts
44 Kudos
Registered: ‎07-20-2011
Post 4 of 5

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
87 Posts
0 Kudos
Registered: ‎05-03-2013
Post 5 of 5

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 interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!