TrackBar control on TabPage

Posted on 2006-04-19
Last Modified: 2008-01-09
I have TrackBar control on TabPage of TabControl (Windows Forms). Background color of TrackBar differs from TabPage background color. TabPage BackColor value is Transparent, and TrackBar BackColor is Control.
Transparent value is not allowed for a control. I tried to set it programmatically:

        private void FormOptions_Load(object sender, EventArgs e)
              trackBar1.BackColor = tabPage1.BackColor;

but this doesn't work. How can I set TrackBar BackColor to have the same background, without hardcoding which can fail on different display settings?
Question by:AlexFM
    LVL 6

    Accepted Solution

    TrackBar doesn't support transparent background color for some strange reason... complain to microsoft..
    The tabPage1.BackColor isn't used when TabPage.UseVisualStyleBackColor is true, for the standard windows theme the tabpage background is actually a gradient.

    Here is a discussion about the problem, there is a link to a modified trackbar dll there, but no source code (I think).
    LVL 48

    Author Comment

    Setting UseVisualStyleBackColor to false is quite enough for me, thanks.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Introduction This article series is supposed to shed some light on the use of IDisposable and objects that inherit from it. In essence, a more apt title for this article would be: using (IDisposable) {}. I’m just not sure how many people would ge…
    It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now