Specifying the Current Language

There are a few different levels at which you can set the current language for your MM .NET applications. These differ slightly for Windows Forms and Web Forms applications.

Something that is similar for both Windows and Web Forms applications is the fact that you can set the default language for an application by means of the Language Manager's CurrentLangauge property. If you don't specify otherwise, this property is automatically set to one (1), which equates to the default language record in the Language table (see the topic Localization Tables for details).

You can set this property at run time as follows:

In C#:

mmAppBase.LanguageMgr.CurrentLanguage = 2;

And in VB .NET:

mmAppBase.LanguageMgr.CurrentLanguage = 2

Specifying the Current Language in Windows Forms

If you have specified a default language for individual users (see the Help topic Step 3: Adding a Language Field to the User Table), then this application-level property is set to the specified value when the user logs in.

In addition to the application level current language setting, the MM .NET mmBaseForm class also has a CurrentLanguage property that can be set at run time to specify a current language for an individual form. Although an application-level setting is usually sufficient in most situations, there may be times when you want application forms to be displayed in different languages.

Here is an example of how you might use this form-level property when displaying a localized message box:

In C#:

mmMessageBox.Show("MyMessageToken",
	"MyCaptionToken",
	MessageBoxButtons.AbortRetryIgnore, 
	MessageBoxIcon.Asterisk, 
	MessageBoxDefaultButton.Button2,
	this.CurrentLanguage);

And in VB .NET:

mmMessageBox.Show("MyMessageToken", _
   "MyCaptionToken", _
   MessageBoxButtons.AbortRetryIgnore, _
   MessageBoxIcon.Asterisk, _
   MessageBoxDefaultButton.Button2, _
   Me.CurrentLanguage)

Specifying the Current Language in Web Forms

In addition to the application level current language setting, MM .NET Web Forms applications also have an mmCurrentLanguage session variable that can be set at run time to specify a current language for an individual user.

If you have specified a default language for individual users (see the Help topic Step 3: Adding a Language Field to the User Table), then the mmCurrentLanguage session variable is set to the specified value when the user logs in.


© (c) 2026 Oak Leaf Enterprises, Inc., 1996-2026 • Updated: 04/26/18
Comment or report problem with topic