Version

Prevent a Tool from Being Activated

Sometimes you do not want a tool to become activated as the mouse is over it. This means that it doesn’t exhibit a "mouse over" appearance, such as being given focus or an image change. The tool will still look enabled, but the ToolClick event will not fire if you click on it.

Add the code below to your project. This will fire as you mouse over a tool and give you the option to check the tool and cancel the event if you like. This will not let the tool to be activated.

In Visual Basic:

Private Sub UltraToolbarsManager1_BeforeToolActivate(ByVal sender As Object, _
  ByVal e As Infragistics.Win.UltraWinToolbars.CancelableToolEventArgs) _
  Handles UltraToolbarsManager1.BeforeToolActivate
	If e.Tool.Index = 4 Then
		e.Cancel = True
	End If
End Sub

In C#:

private void ultraToolbarsManager1_BeforeToolActivate(object sender,
  Infragistics.Win.UltraWinToolbars.CancelableToolEventArgs e)
{
	if(e.Tool.Index == 4)
		e.Cancel = true;
}