Microsoft Knowledge Base Email Alertz

KBAlertz.com: The text on a TabControl control may not be displayed in the .NET Framework 1.1

Receive Microsoft Knowledge Base articles by E-Mail?

Every night we scan the Microsoft Knowledge Base. If technologies you're interested in are updated, we'll send you an e-mail. You only get one e-mail a day, and only when new articles are added.

Click here to create a
FREE account
Already have an account?
[Click here to Login]

Search KbAlertz

Advanced Search

Webmasters
Put kbAlertz on your website.
[ Click Here for more! ]





ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **


Bug Tracking Software
For bug tracking software or defect tracking software or issue tracking software, visit Axosoft.


Community Site



We Send hundreds of thousands of emails using ASP.NET Email



Expert Web Design & Graphic Design
Design44.com

ASP.NET 3.5 Web Hosting with Windows 2008 and SQL 2008: Click Here!
Discount ASP.NET Hosting
ASP.NET 2.0 and 3.5
Windows2008 and SQL2008
US and UK Hosting
The ad says 3 - but KBAlertz referrals get
** SIX MONTHS FREE **




Mentioned In








Microsoft Knowledge Base Article

This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks




Article ID: 905721 - Last Review: May 21, 2007 - Revision: 1.3

The text on a TabControl control may not be displayed in the .NET Framework 1.1

On This Page

SYMPTOMS

In the Microsoft .NET Framework 1.1, the text on a TabControl control may not be displayed when the following conditions are true:
  • You use a Windows Forms application.
  • You use a TabControl control in the application.
  • You try to align the TabControl control on the left or on the right.
  • You enable visual styles for the application by using the EnableVisualStyles method.

CAUSE

This behavior occurs because of a limitation of the TabControl control in Microsoft Common Control 6.0.

WORKAROUND

To work around this behavior, use one of the following methods.

Method 1

Disable visual styles for the application by removing the call to the EnableVisualStyles method.

Method 2

Set the DrawMode property of the TabControl control to the OwnerDrawFixed value. Additionally, add custom code to draw the tabs. For more information, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.tabcontrol.drawmode(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/system.windows.forms.tabcontrol.drawmode(vs.71).aspx)

MORE INFORMATION

Steps to reproduce the behavior

  1. Start Microsoft Visual Studio .NET 2003.
  2. Use Microsoft Visual Basic .NET 2003 to create a Windows Forms application. Name the application myTabControl, and then click OK.
  3. Add a TabControl control to Form1.
  4. In the designer for Form1, right-click the TabControl control, and then click Add Tab.
  5. Perform step 4 three times to add three tabs on the TabControl control.
  6. In Solution Explorer, right-click Form1.vb, and then click View Code to open the code view.
  7. In the definition of TabControl1, add the following code.
    Me.TabControl1.Alignment = TabAlignment.Right
  8. In the definition of TabPage1, use the following code to add text.
    Me.TabPage1.Text = "Any Text"
  9. To reproduce the behavior, you must call the EnableVisualStyles method in the Main function. Use code that is similar to the following before the "Public Sub New()" code block.
    Public Shared Sub Main()
    
                System.Windows.Forms.Application.EnableVisualStyles()
                System.Windows.Forms.Application.Run(New Form1)
            End Sub
  10. On the Project menu, click myTabControl Properties, click Sub Main in the Startup object list, and then click OK.
  11. On the Debug menu, click Start.

REFERENCES

For more information, visit the following MSDN Web site:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.tabcontrol(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/system.windows.forms.tabcontrol(vs.71).aspx)

APPLIES TO
  • Microsoft .NET Framework 1.1
Keywords: 
kbinfo kbprb KB905721
       

Community Feedback System

Very often, it takes hours to solve a problem. Very often, you've looked high and low, and have tried a lot of solutions. When you finally found it, chances are, it was because someone else helped you. Here's your chance to give back. Use our community feedback tool to let others know what worked for you and what didn't.

Please also understand that the community feedback system is not warranted to be correct, it's simply a system that we've built to let people try and help each other. If something in a feedback response doesn't make sense to you, or you're not comfortable making changes that the feedback talks about (like registry edits), please consult a professional.

Thank you for using kbAlertz.com Feedback System.

-- Scott Cate

Be the first to leave feedback, to help others about this knowledge base article.

(Optional) Name

(Optional) Public URL Or Email

Comments
No HTML -- Text Only Please