How to show message box with details and OK option
I want to show a message box with Ok and Detail button in form.I have done
some code for this functionality but it also shows a cancel button and in
detail section it show only that message which i have written in string.
Code is
var dialogTypeName =
"System.Windows.Forms.PropertyGridInternal.GridErrorDlg";
var dialogType = typeof(M3Form).Assembly.GetType(dialogTypeName);
// Create dialog instance.
var dialog = (M3Form)Activator.CreateInstance(dialogType, new
PropertyGrid());
// Populate relevant properties on the dialog instance.
dialog.Text = "Accknowledge Error";
dialogType.GetProperty("Details").SetValue(dialog, "Maximum length has
been exceeded. Maximum = 50, Actual =" + txtName.Text.Length + "", null);
dialogType.GetProperty("Message").SetValue(dialog, "Maximum length has
been exceeded. Maximum = 50, Actual =" + txtName.Text.Length + "", null);
// Display dialog.
var result = dialog.ShowDialog();
How can i show only OK button and detail button with stack trace error
message in detail section.
Was this ever resolved?
ReplyDelete