Connecting Tech Pros Worldwide Help | Site Map

Color theme of toolstrip and menustrip

 
LinkBack Thread Tools Search this Thread
  #1  
Old January 4th, 2006, 04:25 PM
Teemu
Guest
 
Posts: n/a
Default Color theme of toolstrip and menustrip

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


  #2  
Old January 4th, 2006, 10:55 PM
Ken Tucker [MVP]
Guest
 
Posts: n/a
Default 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]


  #3  
Old January 5th, 2006, 04:45 PM
Teemu
Guest
 
Posts: n/a
Default 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

  #4  
Old January 5th, 2006, 04:55 PM
Teemu
Guest
 
Posts: n/a
Default 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

  #5  
Old January 5th, 2006, 07:25 PM
Ken Tucker [MVP]
Guest
 
Posts: n/a
Default 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]


 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

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 220,662 network members.