'宣言 Public Event TabDisplaying As MdiTabEventHandler
public event MdiTabEventHandler TabDisplaying
イベント ハンドラが、このイベントに関連するデータを含む、MdiTabEventArgs 型の引数を受け取りました。次の MdiTabEventArgs プロパティには、このイベントの固有の情報が記載されます。
非表示フォームに関連付けられた MdiTab オブジェクトは HiddenTabs コレクションに格納され、特定の MdiTabGroup には関連付けられません。関連付けられた Form が表示されると、タブは HiddenTabs から削除されて MdiTabGroup に追加されます。TabDisplaying イベントは、タブが MdiTabGroup に追加されたとき、表示が更新される前に呼び出されます。
Imports Infragistics.Win Imports Infragistics.Win.UltraWinTabs Imports Infragistics.Win.UltraWinTabbedMdi Private Sub ultraTabbedMdiManager1_TabDisplaying(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTabbedMdi.MdiTabEventArgs) Handles ultraTabbedMdiManager1.TabDisplaying ' The 'TabDisplaying' event is invoked when a tab in the ' HiddenTabs collection is about to be moved to an ' MdiTabGroup that will display the tab but before the ' display has been updated. ' ' The 'Tab' parameter returns the tab being displayed. ' ' when we are going to show our edit forms, have them all ' in the one tab group If TypeOf e.Tab.Form Is EditForm Then ' if the "Edit" group exists, then move the tab to that group If e.Tab.Manager.TabGroups.Exists("Edit") Then e.Tab.MoveToGroup(e.Tab.Manager.TabGroups("Edit")) Else ' put it in a new tab group ' the method will return the new tab group Dim tabGroup As MdiTabGroup = e.Tab.MoveToNewGroup(MdiTabGroupPosition.Last) ' initialize the key of the tab group tabGroup.Key = "Edit" ' prevent tabs being dragged into this group ' from other groups tabGroup.Settings.AllowDrop = DefaultableBoolean.False End If End If End Sub
using Infragistics.Win; using Infragistics.Win.UltraWinTabs; using Infragistics.Win.UltraWinTabbedMdi; private void ultraTabbedMdiManager1_TabDisplaying(object sender, Infragistics.Win.UltraWinTabbedMdi.MdiTabEventArgs e) { // The 'TabDisplaying' event is invoked when a tab in the // HiddenTabs collection is about to be moved to an // MdiTabGroup that will display the tab but before the // display has been updated. // // The 'Tab' parameter returns the tab being displayed. // // when we are going to show our edit forms, have them all // in the one tab group if (e.Tab.Form is EditForm) { // if the "Edit" group exists, then move the tab to that group if (e.Tab.Manager.TabGroups.Exists("Edit")) e.Tab.MoveToGroup(e.Tab.Manager.TabGroups["Edit"]); else { // put it in a new tab group // the method will return the new tab group MdiTabGroup tabGroup = e.Tab.MoveToNewGroup(MdiTabGroupPosition.Last); // initialize the key of the tab group tabGroup.Key = "Edit"; // prevent tabs being dragged into this group // from other groups tabGroup.Settings.AllowDrop = DefaultableBoolean.False; } } }