バージョン

SelectedTaskPaneTool プロパティ

現在選択されているタスクペインツールを取得または設定します。
シンタックス
'宣言
 
Public Property SelectedTaskPaneTool As ToolBase
public ToolBase SelectedTaskPaneTool {get; set;}
使用例
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";
		}
参照