'宣言 Public Property ActiveTabAppearance As Infragistics.Win.AppearanceBase
public Infragistics.Win.AppearanceBase ActiveTabAppearance {get; set;}
Imports Infragistics.Win Imports Infragistics.Win.UltraWinTabs Imports Infragistics.Win.UltraWinTabControl Private Sub InitializeTabControl() With Me.ultraTabControl1 ' Turn of XP themes support to pick up explicit backcolor ' setting below .SupportThemes = False ' Set the default appearance for all tabs .Appearance.BackColor = Color.Silver .Appearance.BackColor2 = Color.White .Appearance.BackGradientStyle = GradientStyle.HorizontalBump .Appearance.BackGradientAlignment = GradientAlignment.Client ' Set the default appearance for the client area ' which does not include the tab header area .ClientAreaAppearance.BackColor = Color.Silver .ClientAreaAppearance.BackColor2 = Color.White .ClientAreaAppearance.BackGradientStyle = GradientStyle.HorizontalBump .ClientAreaAppearance.BackGradientAlignment = GradientAlignment.Client ' Set a slightly different apperance for the currect ' 'ActiveTab' (the tab with focus) .ActiveTabAppearance.ForeColor = Color.Red ' Set a slightly different apperance for the currect ' 'SelectedTab' (the tab whose tab page is currently visible) .SelectedTabAppearance.ForeColor = Color.Blue ' Set the image background to conform and align with the ' form's BackgroundImage .TabHeaderAreaAppearance.ImageBackground = Me.BackgroundImage .TabHeaderAreaAppearance.ImageBackgroundOrigin = ImageBackgroundOrigin.Form ' Enable hot tracking (tabs hightlight as the mouse passes over them) .HotTrack = True .HotTrackAppearance.ForeColor = Color.FromArgb(255, 0, 255) ' Set AutoSelect on so that if the mouse pauses over ' a tab for half a second the tab will be automatically ' selected .AutoSelect = True .AutoSelectDelay = 500 ' Enable hot tracking (tabs hightlight as the mouse passes over them) .HotTrack = True .HotTrackAppearance.ForeColor = Color.FromArgb(255, 0, 255) ' Allow all tabs but the first tab to be moved .AllowTabMoving = True .Tabs(0).AllowMoving = DefaultableBoolean.False ' Set width constraints (in pixels) on the tabs .MinTabWidth = 35 .MaxTabWidth = 100 ' Set the NavigationStyle property. This determines what ' happens when the user navigates betwen tabs via the ' keyboard (i.e. the arrow keys, page up, page down etc.). ' This assumes that the TabStop property is true and the ' control has focus. .NavigationStyle = NavigationStyle.AutoSelect ' Specify the image size and also to scale larger ' images down to that size but leave smaller images ' unchanged. .ImageSize = New Size(16, 16) .ScaleImages = ScaleImage.OnlyWhenNeeded ' Specify that separators should be shown between buttons. ' This is ignored if the Style property is not set to ' StateButtons .ShowButtonSeparators = True ' Specify that tooltips will be shown when the cursor ' is paused over a tab. ' Note: Tooltips will only be displayed for tab's whose ' 'ToolTipText' property returns a string of at least 1 ' character or the Tab's 'Text' is not fully visible ' due to size constraints. .ShowToolTips = True ' Specify the style of the tabs .Style = UltraTabControlStyle.StateButtons ' Specify the button style. This is ignored if the Style ' property is not set to StateButtons .TabButtonStyle = UIElementButtonStyle.PopupBorderless ' Specify the layout of the tabs. There are various ' single-row and multi-row TabLayoutStyle's available .TabLayoutStyle = TabLayoutStyle.SingleRowAutoSize ' Specify the orientation of the tabs and the text. .TabOrientation = TabOrientation.RightTop .TextOrientation = TextOrientation.HorizontalPlus90 ' Specify the size of the tab page. ' Note: this will cause the control to be resized .TabPageSize = New Size(300, 100) ' Specify the default size of each tab. ' Note: the width is ignored untless the TabLayoutStyle is ' either SingleRowFixed or MultiRowFixed .TabSize = New Size(70, 20) ' Specify the amount of padding around the text and image ' when calcualting the size of the tabs. .TabPadding = New Size(3, 3) ' Specify whether mnemonics will be supported. If so and ' there is an '&' in a tab's text, the following character ' will be treated as an accelerator (i.e. the tab will ' be activated when the user presses the 'Alt' key and ' that character). .UseMnemonics = DefaultableBoolean.True End With End Sub
using System.Diagnostics; using Infragistics.Win; using Infragistics.Win.UltraWinTabs; using Infragistics.Win.UltraWinTabControl; private void InitializeTabControl() { // Turn of XP themes support to pick up explicit backcolor // setting below this.ultraTabControl1.SupportThemes = false; // Set the default appearance for all tabs this.ultraTabControl1.Appearance.BackColor = Color.Silver; this.ultraTabControl1.Appearance.BackColor2 = Color.White; this.ultraTabControl1.Appearance.BackGradientStyle = GradientStyle.HorizontalBump; this.ultraTabControl1.Appearance.BackGradientAlignment = GradientAlignment.Client; // Set the default appearance for the client area // which does not include the tab header area this.ultraTabControl1.ClientAreaAppearance.BackColor = Color.Silver; this.ultraTabControl1.ClientAreaAppearance.BackColor2 = Color.White; this.ultraTabControl1.ClientAreaAppearance.BackGradientStyle = GradientStyle.HorizontalBump; this.ultraTabControl1.ClientAreaAppearance.BackGradientAlignment = GradientAlignment.Client; // Set a slightly different apperance for the currect // 'ActiveTab' (the tab with focus) this.ultraTabControl1.ActiveTabAppearance.ForeColor = Color.Red; // Set a slightly different apperance for the currect // 'SelectedTab' (the tab whose tab page is currently visible) this.ultraTabControl1.SelectedTabAppearance.ForeColor = Color.Blue; // Set the image background to conform and align with the // form's BackgroundImage this.ultraTabControl1.TabHeaderAreaAppearance.ImageBackground = this.BackgroundImage; this.ultraTabControl1.TabHeaderAreaAppearance.ImageBackgroundOrigin = ImageBackgroundOrigin.Form; // Set AutoSelect on so that if the mouse pauses over // a tab for half a second the tab will be automatically // selected this.ultraTabControl1.AutoSelect = true; this.ultraTabControl1.AutoSelectDelay = 500; // Enable hot tracking (tabs hightlight as the mouse passes over them) this.ultraTabControl1.HotTrack = true; this.ultraTabControl1.HotTrackAppearance.ForeColor = Color.FromArgb(255,0,255); // Allow all tabs but the first tab to be moved this.ultraTabControl1.AllowTabMoving = true; this.ultraTabControl1.Tabs[0].AllowMoving = DefaultableBoolean.False; // Set width constraints (in pixels) on the tabs this.ultraTabControl1.MinTabWidth = 35; this.ultraTabControl1.MaxTabWidth = 100; // Set the NavigationStyle property. This determines what // happens when the user navigates betwen tabs via the // keyboard (i.e. the arrow keys, page up, page down etc.). // This assumes that the TabStop property is true and the // control has focus. this.ultraTabControl1.NavigationStyle = NavigationStyle.AutoSelect; // Specify the image size and also to scale larger // images down to that size but leave smaller images // unchanged. this.ultraTabControl1.ImageSize = new Size(16,16); this.ultraTabControl1.ScaleImages = ScaleImage.OnlyWhenNeeded; // Specify that separators should be shown between buttons. // This is ignored if the Style property is not set to // StateButtons this.ultraTabControl1.ShowButtonSeparators = true; // Specify that tooltips will be shown when the cursor // is paused over a tab. // Note: Tooltips will only be displayed for tab's whose // 'ToolTipText' property returns a string of at least 1 // character or the Tab's 'Text' is not fully visible // due to size constraints. this.ultraTabControl1.ShowToolTips = true; // Specify the style of the tabs this.ultraTabControl1.Style = UltraTabControlStyle.StateButtons; // Specify the button style. This is ignored if the Style // property is not set to StateButtons this.ultraTabControl1.TabButtonStyle = UIElementButtonStyle.PopupBorderless; // Specify the layout of the tabs. There are various // single-row and multi-row TabLayoutStyle's available this.ultraTabControl1.TabLayoutStyle = TabLayoutStyle.SingleRowAutoSize; // Specify the orientation of the tabs and the text. this.ultraTabControl1.TabOrientation = TabOrientation.RightTop; this.ultraTabControl1.TextOrientation = TextOrientation.HorizontalPlus90; // Specify the size of the tab page. // Note: this will cause the control to be resized this.ultraTabControl1.TabPageSize = new Size(300, 100); // Specify the default size of each tab. // Note: the width is ignored untless the TabLayoutStyle is // either SingleRowFixed or MultiRowFixed this.ultraTabControl1.TabSize = new Size(70, 20); // Specify the amount of padding around the text and image // when calcualting the size of the tabs. this.ultraTabControl1.TabPadding = new Size(3,3); // Specify whether mnemonics will be supported. If so and // there is an '&' in a tab's text, the following character // will be treated as an accelerator (i.e. the tab will // be activated when the user presses the 'Alt' key and // that character). this.ultraTabControl1.UseMnemonics = DefaultableBoolean.True; }