Hi,
I'm developing a windows form application and have a question.
How can I display error messagebox? I tried to use the DevExpress.XtraEditors.XtraMessageBox, but this don't have the error icons.
Can you help me?
Thanks!
Hi,
I'm developing a windows form application and have a question.
How can I display error messagebox? I tried to use the DevExpress.XtraEditors.XtraMessageBox, but this don't have the error icons.
Can you help me?
Thanks!
The XtraMessageBox.Show method has several overloads that allow you to display error icons much like you can with a standard MessageBox.
For instance:
C#XtraMessageBox.Show("Message Text", "Caption", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
Hi Vasudev,
You can use any required icon from our Image Gallery. See the How to access an image from DX Image Gallery thread for details on how to get an image in code. Then use the approach from the Convert Image file to Icon using C# article to get an Icon object from an image.
I hope you will find it helpful.
That's an outrageous amount of hassle to expect people to go through. I expected XtraMessageBoxArgs to make organizing and passing arguments as easy as passing individual arguments. It should be made as simple as specifying MessageBoxIcon.Error in XtraMessageBoxArgs.Icon or similar property.
Update: After a little digging, I found this works:
XtraMessageBoxArgs args = new XtraMessageBoxArgs();
args.Caption = "Caption";
args.Text = "Message Text";
args.Buttons = new DialogResult[] { DialogResult.Yes, DialogResult.No };
args.Icon = System.Drawing.SystemIcons.Error; // <-- Much simpler
XtraMessageBox.Show(args);
Hi Jonathan,
Yes, that is a correct way of setting the icon of XtraMessageBox.
If you have any questions, please let us know.
Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.
Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.