Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6976733
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:32:07+00:00 2026-05-27T17:32:07+00:00

Just now I noticed that Visual Studio shows a message box with details when

  • 0

Just now I noticed that Visual Studio shows a message box with details when a property is set to an invalid value. For example:

Is it possible to make this type of message box in WinForms?

I have tried the following code:

MessageBox.Show("Error in Division Fill.\n" + ex.Message,
                "Information",            
                MessageBoxButtons.OK,
                MessageBoxIcon.Information,
                MessageBoxOptions.RightAlign);

But this produced the following error:

Error 24 The best overloaded method match for ‘System.Windows.Forms.MessageBox.Show(string, string, System.Windows.Forms.MessageBoxButtons, System.Windows.Forms.MessageBoxIcon, System.Windows.Forms.MessageBoxDefaultButton)’ has some invalid arguments

G:\Jagadeeswaran\Nov 17\MCS-SPS School\MCS-SPS School\Certificate\Transfer.cs 164 21 MCS-SPS School

How can I fix this error and get a message box that shows additional details?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:32:08+00:00Added an answer on May 27, 2026 at 5:32 pm

    As others have pointed out, you should write a custom dialog with the desired features. For help on this, you can look at the actual implementation used by the PropertyGrid for this dialog (perhaps with a decompiler) , which is, as of .NET 4.0, the System.Windows.Forms.PropertyGridInternal.GridErrorDlg type, internal to the System.Windows.Forms assembly.

    I really wouldn’t recommend it (could break in a future release), but if you’re feeling really lazy, you can directly use this internal type using reflection.

    // Get reference to the dialog type.
    var dialogTypeName = "System.Windows.Forms.PropertyGridInternal.GridErrorDlg";
    var dialogType = typeof(Form).Assembly.GetType(dialogTypeName);
    
    // Create dialog instance.
    var dialog = (Form)Activator.CreateInstance(dialogType, new PropertyGrid());
    
    // Populate relevant properties on the dialog instance.
    dialog.Text = "Sample Title";
    dialogType.GetProperty("Details").SetValue(dialog, "Sample Details", null);
    dialogType.GetProperty("Message").SetValue(dialog, "Sample Message", null);
    
    // Display dialog.
    var result = dialog.ShowDialog();
    

    Result:

    Details Dialog

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working in Delphi7 just now, I noticed that not only a VarIsEmpty function exists,
I was checking Microsoft's Visual Studio page just now and in the advertisements sidebar
I noticed this in earlier versions of Visual Studio. But now i use VS
I just noticed that now when using Google Translate, the site is updating also
I've been working on a wordpress theme and just now noticed that the width
I just noticed now that I've updated my app to iOS 5, that when
I've noticed something peculiar about Visual Studio. First, try typing this (C#) somewhere in
I just noticed that my old codes written in python 2.5 does not work
I've noticed that some .NET structs can be compared to null. For example: TimeSpan
I am just starting my first MVC Web Application and have noticed that I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.