Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2005

Tip: Looking for answers? Try searching our database.

TabControl wiht Alignment left and horizontal Text

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Edi - 10 Feb 2005 09:11 GMT
Hello

Is it possible to create a TabControl with Alignment Left and horizontal
Text for the TabPages?

Thanks Edi
Mick Doherty - 10 Feb 2005 10:51 GMT
Set the Tabcontrols SizeMode to Fixed.
Change the TabControls ItemSize property so that it gets serialized.
Change the TabControls DrawMode to OwnerDrawFixed
Then add the following code (assuming your tabcontrol is called TabControl1)
\\\
Private Sub TabControl1_DrawItem(ByVal sender As System.Object, _
           ByVal e As DrawItemEventArgs) Handles TabControl1.DrawItem

   e.Graphics.FillRectangle(SystemBrushes.Control, e.Bounds)
   Dim sf As New StringFormat
   sf.Alignment = StringAlignment.Center
   sf.LineAlignment = StringAlignment.Center
   e.Graphics.DrawString(TabControl1.TabPages(e.Index).Text, _
           TabControl1.Font, SystemBrushes.ControlText, _
           RectangleF.op_Implicit(e.Bounds), sf)
End Sub
///

For some more TabControl tips visit my site:
http://dotnetrix.co.uk/tabcontrols.html

Signature

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

> Hello
>
> Is it possible to create a TabControl with Alignment Left and horizontal
> Text for the TabPages?
>
> Thanks Edi

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.