'宣言 Public Event BeforeToolDragBegin As CancelableToolEventHandler
public event CancelableToolEventHandler BeforeToolDragBegin
イベント ハンドラが、このイベントに関連するデータを含む、CancelableToolEventArgs 型の引数を受け取りました。次の CancelableToolEventArgs プロパティには、このイベントの固有の情報が記載されます。
プロパティ | 解説 |
---|---|
Cancel System.ComponentModel.CancelEventArgsから継承されます。 | |
Tool | ツール |
Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinToolbars Private Sub UltraToolbarsManager1_BeforeToolDragBegin(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinToolbars.CancelableToolEventArgs) Handles UltraToolbarsManager1.BeforeToolDragBegin ' The 'BeforeToolDragBegin' is invoked when a tool drag ' operation is about to be cancelled and provides a way to ' prevent certain tools from being repositioned. ' e.g. allow a user to create a new tool but not ' reposition a tool once its been placed If Not e.Tool.OwnerIsNull And Not e.Tool.OwnerIsToolbarsManager Then e.Cancel = True End If End Sub Private Sub UltraToolbarsManager1_AfterToolDragEnd(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinToolbars.AfterToolDragEventArgs) Handles UltraToolbarsManager1.AfterToolDragEnd ' The 'AfterToolDragEnd' is invoked after a tool drag operation ' is complete and provides a reference to the tool after ' the drag operation as well as an indication of what happened. ' Note that when a tool is removed, it will not longer have ' a reference to the toolbarsmanager or its former owner. To ' reference the toolbarsmanager, you can use the sender of the ' event. System.Diagnostics.Debug.WriteLine(String.Format("The drag of tool {0} has ended with an action of {1}", e.Tool.Key, e.DragAction)) End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinToolbars; private void ultraToolbarsManager1_BeforeToolDragBegin(object sender, Infragistics.Win.UltraWinToolbars.CancelableToolEventArgs e) { // The 'BeforeToolDragBegin' is invoked when a tool drag // operation is about to be cancelled and provides a way to // prevent certain tools from being repositioned. // e.g. allow a user to create a new tool but not // reposition a tool once its been placed if (!e.Tool.OwnerIsNull && !e.Tool.OwnerIsToolbarsManager) e.Cancel = true; } private void ultraToolbarsManager1_AfterToolDragEnd(object sender, Infragistics.Win.UltraWinToolbars.AfterToolDragEventArgs e) { // The 'AfterToolDragEnd' is invoked after a tool drag operation // is complete and provides a reference to the tool after // the drag operation as well as an indication of what happened. // Note that when a tool is removed, it will not longer have // a reference to the toolbarsmanager or its former owner. To // reference the toolbarsmanager, you can use the sender of the // event. System.Diagnostics.Debug.WriteLine( string.Format("The drag of tool {0} has ended with an action of {1}", e.Tool.Key, e.DragAction) ); }