Displaying Security Setup Icons

By default, security setup icons are displayed to the immediate right of a secure user interface control at run time:

However, based on the layout of your forms, you may want to display these icons in a different location.

All forms have a SecurityIconAlign property that specifies the location of the security setup icon. You can change this property to any of the following values:

  • mmSecurityIconAlign.Bottom
  • mmSecurityIconAlign.Left
  • mmSecurityIconAlign.Right
  • mmSecurityIconAlign.Top

When overriding this property in a form, make sure you place the code in the form's constructor before the call to InitializeComponent. This ensures the alignment value is set before any user interface controls instantiate.

For example, in C#:

public CustomerOrdersForm()
{
	this.SecurityIconAlign = mmSecurityIconAlign.Left;

	//
	// Required for Windows Form Designer support
	//
	InitializeComponent();
}

And in VB .NET:

Public Sub New()
   MyBase.New()

   Me.SecurityIconAlign = mmSecurityIconAlign.Left
   
   ' Required for Windows Form Designer support
   InitializeComponent()

End Sub

Displaying Security Setup Icons for Labels

By default, as shown in the figure at the beginning of this topic, a security setup icon is not displayed next to Windows Forms and Web Forms labels at run time when in Security Setup mode. The reason for this is because most labels are associated with other controls such as a textbox, combobox, etc., so there is no need to display an icon for both the label and the control.

If you want to display a security icon for a specific label (for example, a label that doesn't have an associated control), you can simply set its DisplaySecuritySetupIcon property to True in the Properties Window:

If you want to change this default behavior for all labels in your application, create a subclass of the mmLabel class and set its DisplaySecuritySetupIcon property to true.

For example, in C#:

public class CustomLabel : mmLabel
{
	public CustomLabel()
	{
		this.DisplaySecuritySetupIcon = true;
	}
}

And in VB .NET:

Public Class CustomLabel
   Inherits mmLabel
   
   Public Sub New()
      Me.DisplaySecuritySetupIcon = True<
   End Sub

End Class

If you simply want to display a security setup icon for individual labels (for examples, labels that have no associated control), you can specify this in the form's constructor, after the call to InitializeComponent.

For example, in C#:

InitializeComponent();

this.lblOrderID.DisplaySecuritySetupIcon = true;
this.lblCustID.DisplaySecuritySetupIcon = true;

And in VB .NET:

InitalizeComponent

Me.lblOrderID.DisplaySecuritySetupIcon = True
Me.lblCustID.DisplaySecuritySetupIcon = True

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