sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Teemu's Avatar

Color theme of toolstrip and menustrip


Question posted by: Teemu (Guest) on January 4th, 2006 05:25 PM
I'm wondering if there is a easy way to change for example toolstrips
appearance. I'd like to have the same theme as in VB2005. Brown backgroung
instead of the light blue. Can this be done without creating own custom draw
procedure?

Somehow the theme of Visual Studio looks more professional than the original
blue color.

-Teemu

4 Answers Posted
Ken Tucker [MVP]'s Avatar
Ken Tucker [MVP] January 4th, 2006 11:55 PM
Guest - n/a Posts
#2: Re: Color theme of toolstrip and menustrip

Hi,

You can change the color scheme by creating a new ProfessionColorTable.
Then tell the toolstrip renderer to use the new color table. I created a
color table based on the c# code found here.

http://blogs.msdn.com/jfoscoding/articles/489637.aspx

To changing the color scheme of the renderer

ToolStrip1.Renderer = New ToolStripProfessionalRenderer(New TanColorScheme)

Here is the code for the professionalcolortable

Public Class TanColorScheme
Inherits ProfessionalColorTable

Public Overrides ReadOnly Property ButtonCheckedGradientBegin() As
System.Drawing.Color
Get
Return Color.FromArgb(&HC1, 210, &HEE)
End Get
End Property

Public Overrides ReadOnly Property ButtonCheckedGradientEnd() As
System.Drawing.Color
Get
Return Color.FromArgb(&HC1, 210, &HEE)
End Get
End Property

Public Overrides ReadOnly Property ButtonCheckedGradientMiddle() As
System.Drawing.Color
Get
Return Color.FromArgb(&HC1, 210, &HEE)
End Get
End Property

Public Overrides ReadOnly Property ButtonPressedBorder() As
System.Drawing.Color
Get
Return Color.FromArgb(&H31, &H6A, &HC5)
End Get
End Property

Public Overrides ReadOnly Property ButtonPressedGradientBegin() As
System.Drawing.Color
Get
Return Color.FromArgb(&H98, &HB5, &HE2)
End Get
End Property

Public Overrides ReadOnly Property ButtonPressedGradientEnd() As
System.Drawing.Color
Get
Return Color.FromArgb(&H98, &HB5, &HE2)
End Get
End Property

Public Overrides ReadOnly Property ButtonPressedGradientMiddle() As
System.Drawing.Color
Get
Return Color.FromArgb(&H98, &HB5, &HE2)
End Get
End Property

Public Overrides ReadOnly Property ButtonSelectedBorder() As
System.Drawing.Color
Get
Return MyBase.ButtonSelectedBorder
End Get
End Property

Public Overrides ReadOnly Property ButtonSelectedGradientBegin() As
System.Drawing.Color
Get
Return Color.FromArgb(&HC1, 210, &HEE)
End Get
End Property

Public Overrides ReadOnly Property ButtonSelectedGradientEnd() As
System.Drawing.Color
Get
Return Color.FromArgb(&HC1, 210, &HEE)
End Get
End Property

Public Overrides ReadOnly Property ButtonSelectedGradientMiddle() As
System.Drawing.Color
Get
Return Color.FromArgb(&HC1, 210, &HEE)
End Get
End Property

Public Overrides ReadOnly Property CheckBackground() As
System.Drawing.Color
Get
Return Color.FromArgb(&HE1, 230, &HE8)
End Get
End Property

Public Overrides ReadOnly Property CheckPressedBackground() As
System.Drawing.Color
Get
Return Color.FromArgb(&H31, &H6A, &HC5)
End Get
End Property

Public Overrides ReadOnly Property CheckSelectedBackground() As
System.Drawing.Color
Get
Return Color.FromArgb(&H31, &H6A, &HC5)
End Get
End Property

Public Overrides ReadOnly Property GripDark() As System.Drawing.Color
Get
Return Color.FromArgb(&HC1, 190, &HB3)
End Get
End Property

Public Overrides ReadOnly Property GripLight() As System.Drawing.Color
Get
Return Color.FromArgb(&HFF, &HFF, &HFF)
End Get
End Property

Public Overrides ReadOnly Property ImageMarginGradientBegin() As
System.Drawing.Color
Get
Return Color.FromArgb(&HFE, &HFE, &HFB)
End Get
End Property

Public Overrides ReadOnly Property ImageMarginGradientEnd() As
System.Drawing.Color
Get
Return Color.FromArgb(&HBD, &HBD, &HA3)
End Get
End Property

Public Overrides ReadOnly Property ImageMarginGradientMiddle() As
System.Drawing.Color
Get
Return Color.FromArgb(&HEC, &HE7, &HE0)
End Get
End Property

Public Overrides ReadOnly Property ImageMarginRevealedGradientBegin() As
System.Drawing.Color
Get
Return Color.FromArgb(&HF7, &HF6, &HEF)
End Get
End Property

Public Overrides ReadOnly Property ImageMarginRevealedGradientEnd() As
System.Drawing.Color
Get
Return Color.FromArgb(230, &HE3, 210)
End Get
End Property

Public Overrides ReadOnly Property ImageMarginRevealedGradientMiddle()
As System.Drawing.Color
Get
Return Color.FromArgb(&HF2, 240, &HE4)
End Get
End Property

Public Overrides ReadOnly Property MenuBorder() As System.Drawing.Color
Get
Return Color.FromArgb(&H8A, &H86, &H7A)
End Get
End Property

Public Overrides ReadOnly Property MenuItemBorder() As
System.Drawing.Color
Get
Return Color.FromArgb(&H31, &H6A, &HC5)
End Get
End Property

Public Overrides ReadOnly Property MenuItemPressedGradientBegin() As
System.Drawing.Color
Get
Return MyBase.MenuItemPressedGradientBegin
End Get
End Property

Public Overrides ReadOnly Property MenuItemPressedGradientEnd() As
System.Drawing.Color
Get
Return MyBase.MenuItemPressedGradientEnd
End Get
End Property

Public Overrides ReadOnly Property MenuItemPressedGradientMiddle() As
System.Drawing.Color
Get
Return MyBase.MenuItemPressedGradientMiddle
End Get
End Property

Public Overrides ReadOnly Property MenuItemSelected() As
System.Drawing.Color
Get
Return Color.FromArgb(&HC1, 210, &HEE)
End Get
End Property

Public Overrides ReadOnly Property MenuItemSelectedGradientBegin() As
System.Drawing.Color
Get
Return Color.FromArgb(&HC1, 210, &HEE)
End Get
End Property

Public Overrides ReadOnly Property MenuItemSelectedGradientEnd() As
System.Drawing.Color
Get
Return Color.FromArgb(&HC1, 210, &HEE)
End Get
End Property

Public Overrides ReadOnly Property MenuStripGradientBegin() As
System.Drawing.Color
Get
Return Color.FromArgb(&HE5, &HE5, &HD7)
End Get
End Property

Public Overrides ReadOnly Property MenuStripGradientEnd() As
System.Drawing.Color
Get
Return Color.FromArgb(&HF4, &HF2, &HE8)
End Get
End Property

Public Overrides ReadOnly Property OverflowButtonGradientBegin() As
System.Drawing.Color
Get
Return Color.FromArgb(&HF3, &HF2, 240)
End Get
End Property

Public Overrides ReadOnly Property OverflowButtonGradientEnd() As
System.Drawing.Color
Get
Return Color.FromArgb(&H92, &H92, &H76)
End Get
End Property

Public Overrides ReadOnly Property OverflowButtonGradientMiddle() As
System.Drawing.Color
Get
Return Color.FromArgb(&HE2, &HE1, &HDB)
End Get
End Property

Public Overrides ReadOnly Property RaftingContainerGradientBegin() As
System.Drawing.Color
Get
Return Color.FromArgb(&HE5, &HE5, &HD7)
End Get
End Property

Public Overrides ReadOnly Property RaftingContainerGradientEnd() As
System.Drawing.Color
Get
Return Color.FromArgb(&HF4, &HF2, &HE8)
End Get
End Property

Public Overrides ReadOnly Property SeparatorDark() As
System.Drawing.Color
Get
Return Color.FromArgb(&HC5, &HC2, &HB8)
End Get
End Property

Public Overrides ReadOnly Property SeparatorLight() As
System.Drawing.Color
Get
Return Color.FromArgb(&HFF, &HFF, &HFF)
End Get
End Property

Public Overrides ReadOnly Property ToolStripBorder() As
System.Drawing.Color
Get
Return Color.FromArgb(&HA3, &HA3, &H7C)
End Get
End Property

Public Overrides ReadOnly Property ToolStripDropDownBackground() As
System.Drawing.Color
Get
Return Color.FromArgb(&HFC, &HFC, &HF9)
End Get
End Property

Public Overrides ReadOnly Property ToolStripGradientBegin() As
System.Drawing.Color
Get
Return Color.FromArgb(&HF7, &HF6, &HEF)
End Get
End Property

Public Overrides ReadOnly Property ToolStripGradientEnd() As
System.Drawing.Color
Get
Return Color.FromArgb(230, &HE3, 210)
End Get
End Property

Public Overrides ReadOnly Property ToolStripGradientMiddle() As
System.Drawing.Color
Get
Return Color.FromArgb(&HF2, 240, &HE4)
End Get
End Property
End Class

Ken
------------


"Teemu" <tsirkia@hotmail.com> wrote in message
news:dpgvsu$bih$1@phys-news4.kolumbus.fi...[color=blue]
> I'm wondering if there is a easy way to change for example toolstrips
> appearance. I'd like to have the same theme as in VB2005. Brown backgroung
> instead of the light blue. Can this be done without creating own custom
> draw procedure?
>
> Somehow the theme of Visual Studio looks more professional than the
> original blue color.
>
> -Teemu[/color]


Teemu's Avatar
Guest - n/a Posts
#3: Re: Color theme of toolstrip and menustrip


"Ken Tucker [MVP]" <vb2ae@bellsouth.net> kirjoitti
viestissä:OBJcUiYEGHA.3068@TK2MSFTNGP10.phx.gbl... [color=blue]
> Hi,
>
> You can change the color scheme by creating a new ProfessionColorTable.
> Then tell the toolstrip renderer to use the new color table. I created a
> color table based on the c# code found here.
>
> http://blogs.msdn.com/jfoscoding/articles/489637.aspx
>
> To changing the color scheme of the renderer
>
> ToolStrip1.Renderer = New ToolStripProfessionalRenderer(New
> TanColorScheme)
>
> Here is the code for the professionalcolortable[/color]

Thanks for your answer, I'll try that.

-Teemu

Teemu's Avatar
Guest - n/a Posts
#4: Re: Color theme of toolstrip and menustrip


"Teemu" <tsirkia@hotmail.com> kirjoitti
viestissä:dpjl5u$2eu$1@phys-news4.kolumbus.fi...[color=blue]
> Thanks for your answer, I'll try that.[/color]

Yes, this works just how I wanted. I made just a little fine tuning, I
changed ToolStripGradientEnd to Color.FromArgb(192, 192, 168) and now it
looks a bit better.

-Teemu

Ken Tucker [MVP]'s Avatar
Ken Tucker [MVP] January 5th, 2006 08:25 PM
Guest - n/a Posts
#5: Re: Color theme of toolstrip and menustrip

Hi,

Yes it does.

Ken
-------------
"Teemu" <tsirkia@hotmail.com> wrote in message
news:dpjm79$p41$1@phys-news4.kolumbus.fi...[color=blue]
>
> "Teemu" <tsirkia@hotmail.com> kirjoitti
> viestissä:dpjl5u$2eu$1@phys-news4.kolumbus.fi...[color=green]
>> Thanks for your answer, I'll try that.[/color]
>
> Yes, this works just how I wanted. I made just a little fine tuning, I
> changed ToolStripGradientEnd to Color.FromArgb(192, 192, 168) and now it
> looks a bit better.
>
> -Teemu[/color]


 
Not the answer you were looking for? Post your question . . .
196,937 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,937 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors