1

Closed

Predefined VS2012 colors do not match VS exactly

description

In VS2012 if the mouse is over Show All Files menu item of Solution Explorer, the menu item background is white. However, when the predefined VS2012 colors of this customizer is used, the menu item background is blue.

file attachments

Closed Jul 29, 2013 at 3:30 PM by Raider
Not an issue.

comments

Raider wrote May 26, 2013 at 8:36 PM

I cannot reproduce your issue (see attached image "vs2012_backgrounds.jpg"). Wich OS do you use? Can you send me a screenshot?
Thanks.

lextm wrote May 27, 2013 at 12:29 AM

Later this week I am going to provide a video.

lextm wrote Jun 30, 2013 at 3:02 AM

I have attached a short video. When mouse pointer is moved over either the image button on the tool bar, or the Show ID button, as I said above the background color is blue.

This does not match VS2012 as in VS the background color should be white.

lextm wrote Jun 30, 2013 at 3:02 AM

Forgot to mention that I am using VS 2012 on Windows 8.

Raider wrote Jun 30, 2013 at 1:27 PM

.NET ToolStripProfessionalRenderer uses ButtonPressedGradient... colors for both pressed and toggled buttons, i.e. it cannot distinguish these states. I suggest you to use this renderer insted of the standard one, and uncomment Rendering Improvements region. You should slightly modify it to use with your code (replace CustomizableColorTable with your color table, remove ColorTable proeprty, etc), and then you can use it like this:
ToolStripManager.Renderer = CustomToolStripRenderer()
Thanks for the feedback!

lextm wrote Jul 23, 2013 at 2:36 PM

I just started to test out your suggestion, and it resolves the color issue. But it does not yet work as I wished.

For example, in VS the checked menu item has a blue rectangle around it. This blue rectangle is missing even if I followed your tips.

Is there a way to get that rectangle drawn?

lextm wrote Jul 23, 2013 at 2:36 PM

I just started to test out your suggestion, and it resolves the color issue. But it does not yet work as I wished.

For example, in VS the checked menu item has a blue rectangle around it. This blue rectangle is missing even if I followed your tips.

Is there a way to get that rectangle drawn?

Raider wrote Jul 25, 2013 at 12:22 AM

You can set ButtonSelectedBorder to Blue, but this would affect all buttons, not only checkboxes. Standard renderer does not distinguish between checkboxes and normal buttons in this case. Of course, you can always modify standard renderer to fit your needs. For example, to show ButtonSelectedBorder only for Checked buttons, find OnRenderButtonBackground method and update its body with the following code snippet:
if (button.Checked)
{
    pen = ColorTable.ButtonPressedBorder;
    brushBegin = ColorTable.ButtonCheckedGradientBegin;
    brushMiddle = ColorTable.ButtonCheckedGradientMiddle;
    brushEnd = ColorTable.ButtonCheckedGradientEnd;
}
else if (button.Pressed)
{
    pen = Color.Transparent; // !
    brushBegin = ColorTable.ButtonPressedGradientBegin;
    brushMiddle = ColorTable.ButtonPressedGradientMiddle;
    brushEnd = ColorTable.ButtonPressedGradientEnd;
}
else
{
    pen = Color.Transparent; // !
    brushBegin = ColorTable.ButtonSelectedGradientBegin;
    brushMiddle = ColorTable.ButtonSelectedGradientMiddle;
    brushEnd = ColorTable.ButtonSelectedGradientEnd;
}
I trying to keep ToolStrip Customizer as simple as possible, so if you need additional rendering improvements like this, please update your renderer respectively.

lextm wrote Jul 29, 2013 at 12:43 PM

Thanks. I have got it working as you suggested.

lextm wrote Jul 29, 2013 at 12:44 PM

Thanks. I have got it working as you suggested.

lextm wrote Jul 29, 2013 at 12:44 PM

Thanks. I have got it working as you suggested.