HighTechTalks DotNet Forums  

TabControls advice

VB.net Controls microsoft.public.dotnet.languages.vb.controls


Discuss TabControls advice in the VB.net Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Grok
 
Posts: n/a

Default TabControls advice - 02-12-2008 , 04:04 PM






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
=====================================

Reply With Quote
  #2  
Old   
Mick Doherty
 
Posts: n/a

Default Re: TabControls advice - 02-13-2008 , 03:59 AM






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

--
Mick Doherty
http://www.dotnetrix.co.uk/nothing.html


"Grok" <grok (AT) valhallalegends (DOT) com> wrote

Quote:
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
=====================================



Reply With Quote
  #3  
Old   
Grok
 
Posts: n/a

Default Re: TabControls advice - 02-13-2008 , 10:50 AM



On Wed, 13 Feb 2008 09:59:50 -0000, "Mick Doherty"
<EXCHANGE#WITH (AT) AND (DOT) REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]>
wrote:

Quote:
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
Good to know that the controls are flawed and not the user =)
Owner-drawing the controls is a little advanced for my current needs,
but I did bookmark the page for if/when I do need it.
Thanks


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.