Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 232859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T20:03:10+00:00 2026-05-11T20:03:10+00:00

I am trying to get a ToolStripPanel to have the same drawing style as

  • 0

I am trying to get a ToolStripPanel to have the same drawing style as the embedded ToolStrips, so that it looks like one continuous bar. I have the ToolStrips using the ToolStripProfessionalRenderer so that they are styled the same as the Windows Task Bar.

I have gotten close by creating a new Renderer derived from ToolStripProfessionalRenderer:

   class CustomRenderer : ToolStripProfessionalRenderer
   {
      protected override void OnRenderToolStripPanelBackground(ToolStripPanelRenderEventArgs e)
      {
         base.OnRenderToolStripPanelBackground(e);

         LinearGradientBrush lgb = new LinearGradientBrush(e.ToolStripPanel.ClientRectangle, this.ColorTable.ToolStripGradientBegin, this.ColorTable.ToolStripGradientEnd, LinearGradientMode.Vertical);
         e.Graphics.FillPath(lgb, e.ToolStripPanel.ClientRectangle);
      }
   }

This creates the gradient look with the correct colors, but they do not match up quite right. It seems as if the gradient has a higher number of colors, so the spread is drawn out longer.

I have accounted for the border of the ToolStrips (which is not shown in this code), yet they still don’t match up quite right.

Anyone know how to make this happen?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T20:03:10+00:00Added an answer on May 11, 2026 at 8:03 pm

    I finally figured this out — and I seems so obvious now.

    The ColorTable in the ToolStripPanelProfessionalRenderer has three colors we are interested in:

    ColorTable.ToolStripGradientBegin
    ColorTable.ToolStripGradientMiddle
    ColorTable.ToolStripGradientEnd

    The background needs to be painted in two parts — the top gradient, and the bottom gradient.

    The top goes from the ‘Begin’ color to the ‘Middle’ color, and the bottom goes from the ‘Middle’ color to the ‘End’ color.

    Looks perfect…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to get into PostgreSQL. I'm drawing an function that will check credentials Here
I am trying get a div that I have hidden to show in the
trying to get same string on tooltip as is in the Text e.g. Text=<%#
Trying to get a login script working, I kept getting the same login page
Trying to get a form for adding, editing and removing embedded documents working as
I'm trying get to know decorators, and I have a problem with sharing value,
I am trying get my hands dirty with async CTP and I noticed that
I am trying get this background to fade in on click. I found one
I have a form and there is no control.I am trying get the controls
I'm new to Drupal and trying get my head around it. I'd like to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.