![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I seem to be failing at TabControls. To see the effects of Apperance and Alignment combinations, I wrote the following form. GOOD: http://www.valhallalegends.com/images/dotnet/TCNormalTop.jpg GOOD: http://www.valhallalegends.com/images/dotnet/TCNormalLeft.jpg When I switch Apperance to Buttons, only the Top alignment works as expected. Left or Right produces a huge margin, while Bottom does not show my TabPages at all. FAIL: http://www.valhallalegends.com/images/dotnet/TCButtons.Left.jpg FAIL: http://www.valhallalegends.com/images/dotnet/TCButtonsBottom.jpg Did I forget a property setting? ===================================== Public Class Form1 Private Sub Appearance_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioAppearanceNormal.CheckedChanged, RadioAppearanceButtons.CheckedChanged, RadioAppearanceFlatButtons.CheckedChanged Try Dim MyRadio As RadioButton = CType(sender, RadioButton) Select Case MyRadio.Text Case "Normal" TabControl1.Appearance = TabAppearance.Normal Case "Buttons" TabControl1.Appearance = TabAppearance.Buttons Case "FlatButtons" TabControl1.Appearance = TabAppearance.FlatButtons End Select Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub Private Sub Alignment_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioAlignmentTop.CheckedChanged, RadioAlignmentLeft.CheckedChanged, RadioAlignmentRight.CheckedChanged, RadioAlignmentBottom.CheckedChanged Try Dim MyRadio As RadioButton = CType(sender, RadioButton) Select Case MyRadio.Text Case "Top" TabControl1.Alignment = TabAlignment.Top Case "Left" TabControl1.Alignment = TabAlignment.Left Case "Right" TabControl1.Alignment = TabAlignment.Right Case "Bottom" TabControl1.Alignment = TabAlignment.Bottom End Select Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub End Class ===================================== |
#3
| |||
| |||
|
|
TabControl is flawed in that condition. You'll need to Inherit it and override the DisplayRectangle to correct it. See the "Add a HideTabs property to turn on/off the Tabs" article on my site for an example. http://www.dotnetrix.co.uk/tabcontrols.html |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |