バージョン

BeforeTaskPaneToolSelected イベント

SelectedTaskPaneTool が変更される前に発生します。
シンタックス
'宣言
 
Public Event BeforeTaskPaneToolSelected As BeforeTaskPaneToolSelectedEventHandler
public event BeforeTaskPaneToolSelectedEventHandler BeforeTaskPaneToolSelected
イベント データ

イベント ハンドラが、このイベントに関連するデータを含む、BeforeTaskPaneToolSelectedEventArgs 型の引数を受け取りました。次の BeforeTaskPaneToolSelectedEventArgs プロパティには、このイベントの固有の情報が記載されます。

プロパティ解説
Cancel System.ComponentModel.CancelEventArgsから継承されます。 
TaskPaneToolbar SelectedTaskPaneTool が変更されている UltraTaskPaneToolbar
Tool Infragistics.Win.UltraWinToolbars.CancelableToolEventArgsから継承されます。ツール
解説

このイベントは、TaskPaneToolSelectedTaskPaneTool になる前に発生します。

使用例
Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinToolbars

	Private Sub UltraButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles UltraButton3.Click
		' UltraTaskPaneToolbar is a derived UltraToolbar so
		' it must be cast to the derived type when retreived
		' from the Toolbars collection of the component
		Dim taskPane As UltraTaskPaneToolbar = CType(Me.UltraToolbarsManager1.Toolbars("TaskPaneDemo"), UltraTaskPaneToolbar)

		' when the 'SelectedTaskPaneTool' property is set, the
		' tool will be selected and its associated Control 
		' will be displayed in the content area of the task pane.
		taskPane.SelectedTaskPaneTool = taskPane.Tools("dayview")
	End Sub

	Private Sub UltraToolbarsManager1_BeforeTaskPaneToolSelected(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinToolbars.BeforeTaskPaneToolSelectedEventArgs) Handles UltraToolbarsManager1.BeforeTaskPaneToolSelected
		' The BeforeTaskPaneToolSelected is invoked immediately before
		' the 'SelectedTaskPaneTool' property of an UltraTaskPaneToolbar 
		' has been changed. This event is cancellable and can be used to 
		' prevent the selected task pane from being changed.
		If e.Tool.Key = "monthview" Then
			e.Cancel = True
		End If
	End Sub

	Private Sub UltraToolbarsManager1_AfterTaskPaneToolSelected(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinToolbars.TaskPaneToolbarEventArgs) Handles UltraToolbarsManager1.AfterTaskPaneToolSelected
		' The AfterTaskPaneToolSelected event is invoked immediately after
		' the 'SelectedTaskPaneTool' property of an UltraTaskPaneToolbar
		' has been changed. This event can be used to initialize properties
		' of a task pane tool or its associated control.
		'
		If Not e.TaskPaneToolbar.SelectedTaskPaneTool Is Nothing AndAlso Not e.TaskPaneToolbar.SelectedTaskPaneTool.Control Is Nothing Then
			e.TaskPaneToolbar.SelectedTaskPaneTool.Control.Text = "Changed"
		End If
	End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinToolbars;

		private void ultraButton3_Click(object sender, System.EventArgs e)
		{
			// UltraTaskPaneToolbar is a derived UltraToolbar so
			// it must be cast to the derived type when retreived
			// from the Toolbars collection of the component
			UltraTaskPaneToolbar taskPane = this.ultraToolbarsManager1.Toolbars["TaskPaneDemo"] as UltraTaskPaneToolbar;

			// when the 'SelectedTaskPaneTool' property is set, the
			// tool will be selected and its associated Control 
			// will be displayed in the content area of the task pane.
			taskPane.SelectedTaskPaneTool = taskPane.Tools["dayview"];
		}

		private void ultraToolbarsManager1_BeforeTaskPaneToolSelected(object sender, Infragistics.Win.UltraWinToolbars.BeforeTaskPaneToolSelectedEventArgs e)
		{
			// The BeforeTaskPaneToolSelected is invoked immediately before
			// the 'SelectedTaskPaneTool' property of an UltraTaskPaneToolbar 
			// has been changed. This event is cancellable and can be used to 
			// prevent the selected task pane from being changed.
			if (e.Tool.Key == "monthview")
				e.Cancel = true;
		}

		private void ultraToolbarsManager1_AfterTaskPaneToolSelected(object sender, Infragistics.Win.UltraWinToolbars.TaskPaneToolbarEventArgs e)
		{
			// The AfterTaskPaneToolSelected event is invoked immediately after
			// the 'SelectedTaskPaneTool' property of an UltraTaskPaneToolbar
			// has been changed. This event can be used to initialize properties
			// of a task pane tool or its associated control.
			//
			if (e.TaskPaneToolbar.SelectedTaskPaneTool != null && e.TaskPaneToolbar.SelectedTaskPaneTool.Control != null)
				e.TaskPaneToolbar.SelectedTaskPaneTool.Control.Text = "Changed";
		}
参照