Showing Localized Windows Forms
Although you can usually call a Window Forms Show or ShowDialog method directly to show a non-modal or modal form, you should use the MM .NET Form Manager's Show and ShowDialog methods instead within a localized Windows Forms application.
The reason for calling these alternate methods on the Form Manager is it allows modal dialogs to be displayed non-modally when the application is in Localization Setup mode. This is critical for allowing users to launch all application forms and localize them.
Calling the Form Manager's Show Method
The Form Manager's Show method has two overloads:- Shows the specified form as non-modal. If an MDI parent form is specified, use it to set the MdiParent property of the form to be shown
public virtual void Show(Form form, Form parentForm)
Public Overridable Sub Show(form As Form, parentForm As Form)
- Show the specified form as non-modal
public virtual void Show(Form form)
Public Overridable Sub Show(form As Form)
Example
Here's an example using the Form Manager's Show method:
In C#:
private void ListsRolesBar_Click(object sender, System.EventArgs e)
{
mmAppDesktop.FormMgr.Show(new mmRolesForm(), this);
}And in VB .NET:
Private Sub ListsRolesBar_Click(sender As Object, e As System.EventArgs)
mmAppDesktop.FormMgr.Show(New mmRolesForm(), Me)
End SubIn this sample code, the reference to this and Me are references to the application's main MDI form.
Calling the Form Manager's ShowDialog Method
The Form Manager's ShowDialog method has a single signature:- Shows the specified form as modal. If the application is in Localize Setup mode, all forms are displayed as non-modal so they can be localized at run time
public virtual DialogResult ShowDialog(Form form)
Public Overridable Function ShowDialog(form As Form) As DialogResult
If the application is running in Localize Setup mode, this method calls the specified form's Show method rather than ShowDialog. This makes sure the form is not modal and can be localized. When running in Localize Setup mode, this method always returns DialogResult.None. If the application is NOT running in Localize Setup mode, this method calls the specified form's ShowDialog method, the form is displayed as a modal dialog, and the DialogResult value of the modal dialog is passed back from this method.
Example
Here's an example using the Form Manager's ShowDialog method:
In C#:
private void ListsRolesBar_Click(object sender, System.EventArgs e)
{
DialogResult Result = mmAppDesktop.FormMgr.ShowDialog(new mmRolesForm());
// Check the Result and process accordingly
}And in VB .NET:
Private Sub ListsRolesBar_Click(sender As Object, e As System.EventArgs)
mmAppDesktop.FormMgr.ShowDialog(New mmRolesForm())
' Check the Result and process accordingly
End Sub
© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 04/26/18
Comment or report problem with topic
