Version

SetEnabled(TabbedMdiEventIds,Boolean) Method

Enables or disables the event identified by the eventid.
Syntax
'Declaration
 
Public Overloads Sub SetEnabled( _
   ByVal eventid As TabbedMdiEventIds, _
   ByVal enabled As Boolean _
) 
public void SetEnabled( 
   TabbedMdiEventIds eventid,
   bool enabled
)

Parameters

eventid
One of the TabbedMdiEventIds indicating which event to update.
enabled
The state that will be assigned to the event. Specify True to enable the event, or False to disable it.
Remarks

The EventManager is used to selectively enable and disable events for the control. You can use this method to enable or disable any event in the control by specifying the event's unique ID and the state you want the event to be set to.

Caution Do not disable an event before it has finished processing. Disabling an event while it is still processing can produce unpredictable results. You should use the InProgress(TabbedMdiEventIds) method to check whether an event is currently processing code before disabling the event.

Example
The following example demonstrates how to use the 'EventManager' of the UltraTabbedMdiManager.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTabs
Imports Infragistics.Win.UltraWinTabbedMdi

  Private Sub miEventManager_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles miEventManager.Click
      ' The event manager is used to temporarily disable events
      ' to prevent them from being raised. This can be very
      ' convenient in a situation where one or more properties
      ' are being set in code and the events they would normally 
      ' raise would cause unnecessary or counter-productive
      ' code to be executed.
      '
      ' Note: All events are enabled by default.

      ' Get the component's event manager.
      Dim eventManager As TabbedMdiEventManager = Me.ultraTabbedMdiManager1.EventManager

      ' Disable the events that will be invoked when a tab is moved
      ' to a new group
      eventManager.SetEnabled(TabbedMdiEventIds.TabGroupResizing, False)
      eventManager.SetEnabled(TabbedMdiEventIds.TabGroupResized, False)
      eventManager.SetEnabled(TabbedMdiEventIds.TabMoving, False)
      eventManager.SetEnabled(TabbedMdiEventIds.TabMoved, False)

      ' Move a tab in the first group to a new group
      ' Note: Moving the tab to a new group will normally cause the 
      ' TabMoving/ed and TabGroupResizing/ed events to be invoked since 
      ' we have disabled them, they won't be raised.
      If Me.ultraTabbedMdiManager1.TabGroups.Count > 0 AndAlso Me.ultraTabbedMdiManager1.TabGroups(0).Tabs.Count > 1 Then
          Me.ultraTabbedMdiManager1.TabGroups(0).Tabs(0).MoveToNewGroup(MdiTabGroupPosition.Last)
      End If

      ' Re-enable the events
      eventManager.SetEnabled(TabbedMdiEventIds.TabGroupResizing, True)
      eventManager.SetEnabled(TabbedMdiEventIds.TabGroupResized, True)
      eventManager.SetEnabled(TabbedMdiEventIds.TabMoving, True)
      eventManager.SetEnabled(TabbedMdiEventIds.TabMoved, True)

      ' The 'AllEventsEnabled' property lets you enable/disable
      ' all events will a single line of code. If any event is 
      ' disabled the 'AllEventsEnabled' property returns false.
      If Not eventManager.AllEventsEnabled Then
          eventManager.AllEventsEnabled = True
      End If

      ' The event manager also exposes an 'IsEnabled' method
      ' to see if an event is enabled or disbled.
      If Not eventManager.IsEnabled(TabbedMdiEventIds.InitializeTab) Then
          eventManager.SetEnabled(TabbedMdiEventIds.InitializeTab, True)
      End If

      ' The event manager also exposes overloaded 
      ' 'IsEnabled' and 'SetEnabled' methods that take an  
      ' event group so that, for example all 'Before' or all
      ' 'After' events can be enabled/disabled. If any event
      ' in the group is disabled the 'IsEnabled' method returns
      ' false.
      If Not eventManager.IsEnabled(TabbedMdiEventGroups.BeforeEvents) Then
          eventManager.SetEnabled(TabbedMdiEventGroups.BeforeEvents, True)
      End If

      eventManager.SetEnabled(TabbedMdiEventGroups.AfterEvents, True)

      ' The 'InProgress' method will return true if the 
      ' specified event is currently being raised. This
      ' is often helpful in methods that can be called
      ' from various points in an application to determine
      ' what is triggering the call.
      If eventManager.InProgress(TabbedMdiEventIds.TabDisplaying) Then
          ' ... 
      End If
  End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinTabs;
using Infragistics.Win.UltraWinTabbedMdi;

private void miEventManager_Click(object sender, System.EventArgs e)
{
	// The event manager is used to temporarily disable events
	// to prevent them from being raised. This can be very
	// convenient in a situation where one or more properties
	// are being set in code and the events they would normally 
	// raise would cause unnecessary or counter-productive
	// code to be executed.
	//
	// Note: All events are enabled by default.
	
	// Get the component's event manager.
	TabbedMdiEventManager eventManager = this.ultraTabbedMdiManager1.EventManager;

	// Disable the events that will be invoked when a tab is moved
	// to a new group
	eventManager.SetEnabled( TabbedMdiEventIds.TabGroupResizing, false );
	eventManager.SetEnabled( TabbedMdiEventIds.TabGroupResized, false );
	eventManager.SetEnabled( TabbedMdiEventIds.TabMoving, false );
	eventManager.SetEnabled( TabbedMdiEventIds.TabMoved, false );

	// Move a tab in the first group to a new group
	// Note: Moving the tab to a new group will normally cause the 
	// TabMoving/ed and TabGroupResizing/ed events to be invoked since 
	// we have disabled them, they won't be raised.
	if (this.ultraTabbedMdiManager1.TabGroups.Count > 0 &&
		this.ultraTabbedMdiManager1.TabGroups[0].Tabs.Count > 1)
	{
		this.ultraTabbedMdiManager1.TabGroups[0].Tabs[0].MoveToNewGroup(MdiTabGroupPosition.Last);
	}

	// Re-enable the events
	eventManager.SetEnabled( TabbedMdiEventIds.TabGroupResizing, true );
	eventManager.SetEnabled( TabbedMdiEventIds.TabGroupResized, true );
	eventManager.SetEnabled( TabbedMdiEventIds.TabMoving, true );
	eventManager.SetEnabled( TabbedMdiEventIds.TabMoved, true );

	// The 'AllEventsEnabled' property lets you enable/disable
	// all events will a single line of code. If any event is 
	// disabled the 'AllEventsEnabled' property returns false.
	if ( !eventManager.AllEventsEnabled )
		eventManager.AllEventsEnabled = true;

	// The event manager also exposes an 'IsEnabled' method
	// to see if an event is enabled or disbled.
	if ( !eventManager.IsEnabled(TabbedMdiEventIds.InitializeTab ) )
		eventManager.SetEnabled(TabbedMdiEventIds.InitializeTab, true );

	// The event manager also exposes overloaded 
	// 'IsEnabled' and 'SetEnabled' methods that take an  
	// event group so that, for example all 'Before' or all
	// 'After' events can be enabled/disabled. If any event
	// in the group is disabled the 'IsEnabled' method returns
	// false.
	if ( !eventManager.IsEnabled(TabbedMdiEventGroups.BeforeEvents ) )
		eventManager.SetEnabled(TabbedMdiEventGroups.BeforeEvents, true );

	eventManager.SetEnabled(TabbedMdiEventGroups.AfterEvents, true );

	// The 'InProgress' method will return true if the 
	// specified event is currently being raised. This
	// is often helpful in methods that can be called
	// from various points in an application to determine
	// what is triggering the call.
	if ( eventManager.InProgress( TabbedMdiEventIds.TabDisplaying ) )
	{
		// ... 
	}
}
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