バージョン

InitializeTab イベント

mdi 子フォームに対して新しい MdiTab が 作成されるときに発生するイベント。
シンタックス
'宣言
 
Public Event InitializeTab As MdiTabEventHandler
public event MdiTabEventHandler InitializeTab
イベント データ

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

プロパティ解説
Tab 関連付けられた MdiTab を返します。
解説

InitializeTab イベントは、mdi 子フォームに対して新しい MdiTab が作成されるとき、そのタブが MdiTabGroup と関連付けられる前に起動されます。このイベントは、タブが表示される前にタブを初期化する機会を提供します。

注: MdiTabEventArgs.Tab で move メソッドのいずれか (MoveToNewGroup(MdiTab) など) を呼び出すと、例外が発生します。

使用例
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTabs
Imports Infragistics.Win.UltraWinTabbedMdi

Private Sub ultraTabbedMdiManager1_InitializeTab(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTabbedMdi.MdiTabEventArgs) Handles ultraTabbedMdiManager1.InitializeTab
    ' The 'InitializeTab' event can be used to initialize the
    ' settings for a new tab. The event is invoked when a new 
    ' MdiTab is created for a form. The 'Tab' parameter provides 
    ' the tab being initialized.
    '

    ' The text displayed by the tab is, by default, based 
    ' on the Text property of the form. The 'Text' property 
    ' of the tab may be set to override that value.
    e.Tab.Text = "New MdiChild " & e.Tab.Form.MdiParent.MdiChildren.Length

    ' This event is probably a good point to initialize the 'Key' 
    ' of the tab so that the tab may be located by this string later.
    '
    'e.Tab.Key = "abc"

    ' The 'Form' property is initialized by the time this event 
    ' is invoked and returns the mdi child form that the tab is 
    ' associated with.
    '
    If TypeOf e.Tab.Form Is MdiChildDialog Then
        e.Tab.ToolTip = "Mdi Child Dialog"
    End If

    ' The 'Settings' property of the tab will return an 
    ' MdiTabSettings instance that can be used to initialize
    ' the settings specifically for this tab.
    '

    ' The 'DisplayFormIcon' can be used to set the default 
    ' image of the tab to the icon of the associated form.
    '
    e.Tab.Settings.DisplayFormIcon = DefaultableBoolean.True
End Sub
using Infragistics.Win;
using Infragistics.Win.UltraWinTabs;
using Infragistics.Win.UltraWinTabbedMdi;

private void ultraTabbedMdiManager1_InitializeTab(object sender, Infragistics.Win.UltraWinTabbedMdi.MdiTabEventArgs e)
{
	// The 'InitializeTab' event can be used to initialize the
	// settings for a new tab. The event is invoked when a new 
	// MdiTab is created for a form. The 'Tab' parameter provides 
	// the tab being initialized.
	//

	// The text displayed by the tab is, by default, based 
	// on the Text property of the form. The 'Text' property 
	// of the tab may be set to override that value.
	e.Tab.Text = "New MdiChild " + e.Tab.Form.MdiParent.MdiChildren.Length;

	// This event is probably a good point to initialize the 'Key' 
	// of the tab so that the tab may be located by this string later.
	//
	//e.Tab.Key = "abc";

	// The 'Form' property is initialized by the time this event 
	// is invoked and returns the mdi child form that the tab is 
	// associated with.
	//
	if ( e.Tab.Form is MdiChildDialog )
		e.Tab.ToolTip = "Mdi Child Dialog";

	// The 'Settings' property of the tab will return an 
	// MdiTabSettings instance that can be used to initialize
	// the settings specifically for this tab.
	//
	
	// The 'DisplayFormIcon' can be used to set the default 
	// image of the tab to the icon of the associated form.
	//
	e.Tab.Settings.DisplayFormIcon = DefaultableBoolean.True;
}
参照