Version

Margins Property

Returns a Infragistics.Win.Margins object which holds values for the Left, Right, Top and Bottom margins of the control (i.e., the internal padding between the edges of the control and the edges of the Groups)
Syntax
'Declaration
 
Public ReadOnly Property Margins As Infragistics.Win.Margins
public Infragistics.Win.Margins Margins {get;}
Remarks

Specify -1 for any of the 4 properties on the Margins object to force the UltraExplorerBar to use default values based on the Style.

The default margins for UltraExplorerBarStyle '0 - ExplorerBar' are 15, 15, 15, 15.

The default margins for all other UltraExplorerBarStyles are 0, 0, 0, 0.

Example
The following code shows how to set the control's Margins property as well as the Group's ItemAreaMargins property. it also shows how to query the resolved values of both margin settings.

Imports System.Diagnostics
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinExplorerBar


	Private Sub Button11_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles button11.Click

		' -------------------------------------------------------------------------------------
		' Set the top and bottom margins of the control to 5, and retain the default margins on
		' the left and right.
		Me.ultraExplorerBar1.Margins.Left = -1
		Me.ultraExplorerBar1.Margins.Top = 5
		Me.ultraExplorerBar1.Margins.Right = -1
		Me.ultraExplorerBar1.Margins.Bottom = 5


		' Display the resolved margin settings.  Any margin value set to -1 (the default setting)
		' will resolve to a specific default based on the control style.
		Dim messageText As String = "The resolved margin settings for the control are Left: {0}, Top: {1}, Right: {2}, Bottom: {3}"
		Dim messageTextFormatted As String = String.Format(messageText, Me.ultraExplorerBar1.MarginsResolved.Left.ToString(), _
					   Me.ultraExplorerBar1.MarginsResolved.Top.ToString(), _
					   Me.ultraExplorerBar1.MarginsResolved.Right.ToString(), _
					   Me.ultraExplorerBar1.MarginsResolved.Bottom.ToString())

		Debug.WriteLine(messageTextFormatted)


		' -------------------------------------------------------------------------------------
		' Set the left and right margins of the Group item area to 3 on the left and right, and
		' retain the default margins on the top and bottom.  Make these settings on the control's
		' GroupSettings objects which will make them the default settings for the item areas of
		' all Groups.  We will then override the item area margins for the first group below.
		Me.ultraExplorerBar1.GroupSettings.ItemAreaMargins.Left = 3
		Me.ultraExplorerBar1.GroupSettings.ItemAreaMargins.Top = -1
		Me.ultraExplorerBar1.GroupSettings.ItemAreaMargins.Right = 3
		Me.ultraExplorerBar1.GroupSettings.ItemAreaMargins.Bottom = -1


		' Display the resolved item area margin settings for all groups.  Any margin value set
		' to -1 (the default setting) will resolve to a specific default based on the control
		' style.
		messageText = "The resolved item area margin settings for all Groups are Left: {0}, Top: {1}, Right: {2}, Bottom: {3}"
		messageTextFormatted = String.Format(messageText, Me.ultraExplorerBar1.GroupSettings.ItemAreaMarginsResolved.Left.ToString(), _
					  Me.ultraExplorerBar1.GroupSettings.ItemAreaMarginsResolved.Top.ToString(), _
					  Me.ultraExplorerBar1.GroupSettings.ItemAreaMarginsResolved.Right.ToString(), _
					  Me.ultraExplorerBar1.GroupSettings.ItemAreaMarginsResolved.Bottom.ToString())

		Debug.WriteLine(messageTextFormatted)


		' Override the item area margin settings for the first Group.
		If (Me.ultraExplorerBar1.Groups.Count > 0) Then
			Me.ultraExplorerBar1.Groups(0).Settings.ItemAreaMargins.Left = 7
			Me.ultraExplorerBar1.Groups(0).Settings.ItemAreaMargins.Top = 2
			Me.ultraExplorerBar1.Groups(0).Settings.ItemAreaMargins.Right = 7
			Me.ultraExplorerBar1.Groups(0).Settings.ItemAreaMargins.Bottom = 2
		End If

	End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinExplorerBar;


		private void button11_Click(object sender, System.EventArgs e)
		{
			// -------------------------------------------------------------------------------------
			// Set the top and bottom margins of the control to 5, and retain the default margins on
			// the left and right.
			this.ultraExplorerBar1.Margins.Left		= -1;
			this.ultraExplorerBar1.Margins.Top		= 5;
			this.ultraExplorerBar1.Margins.Right	= -1;
			this.ultraExplorerBar1.Margins.Bottom	= 5;


			// Display the resolved margin settings.  Any margin value set to -1 (the default setting)
			// will resolve to a specific default based on the control style.
			string messageText			= "The resolved margin settings for the control are Left: {0}, Top: {1}, Right: {2}, Bottom: {3}";
			string messageTextFormatted = string.Format(messageText, this.ultraExplorerBar1.MarginsResolved.Left.ToString(),
																	 this.ultraExplorerBar1.MarginsResolved.Top.ToString(),
																	 this.ultraExplorerBar1.MarginsResolved.Right.ToString(),
																	 this.ultraExplorerBar1.MarginsResolved.Bottom.ToString());

			Debug.WriteLine(messageTextFormatted);


			// -------------------------------------------------------------------------------------
			// Set the left and right margins of the Group item area to 3 on the left and right, and
			// retain the default margins on the top and bottom.  Make these settings on the control's
			// GroupSettings objects which will make them the default settings for the item areas of
			// all Groups.  We will then override the item area margins for the first group below.
			this.ultraExplorerBar1.GroupSettings.ItemAreaMargins.Left	= 3;
			this.ultraExplorerBar1.GroupSettings.ItemAreaMargins.Top	= -1;
			this.ultraExplorerBar1.GroupSettings.ItemAreaMargins.Right	= 3;
			this.ultraExplorerBar1.GroupSettings.ItemAreaMargins.Bottom	= -1;


			// Display the resolved item area margin settings for all groups.  Any margin value set
			// to -1 (the default setting) will resolve to a specific default based on the control
			// style.
			messageText			 = "The resolved item area margin settings for all Groups are Left: {0}, Top: {1}, Right: {2}, Bottom: {3}";
			messageTextFormatted = string.Format(messageText, this.ultraExplorerBar1.GroupSettings.ItemAreaMarginsResolved.Left.ToString(),
															  this.ultraExplorerBar1.GroupSettings.ItemAreaMarginsResolved.Top.ToString(),
															  this.ultraExplorerBar1.GroupSettings.ItemAreaMarginsResolved.Right.ToString(),
															  this.ultraExplorerBar1.GroupSettings.ItemAreaMarginsResolved.Bottom.ToString());

			Debug.WriteLine(messageTextFormatted);


			// Override the item area margin settings for the first Group.
			if (this.ultraExplorerBar1.Groups.Count > 0)
			{
				this.ultraExplorerBar1.Groups[0].Settings.ItemAreaMargins.Left		= 7;
				this.ultraExplorerBar1.Groups[0].Settings.ItemAreaMargins.Top		= 2;
				this.ultraExplorerBar1.Groups[0].Settings.ItemAreaMargins.Right		= 7;
				this.ultraExplorerBar1.Groups[0].Settings.ItemAreaMargins.Bottom	= 2;
			}
		}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also