Home All Groups Group Topic Archive Search About

VB 2005 Visual Styles problem

Author
18 Aug 2006 1:01 PM
nkarnold
My application seems to be ignoring Enable XP visual styles, which is
ticked on in the application properties.

the Toolbar and Menubar, which appear the nice looking shaded blue
appear like that whilst in the IDE, but when I run the app, they both
go to boring grey.

In the application.designer.vb self generated file, it does have
PublicSubNew()
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.Authent
icationMode.Windows)
Me.IsSingleInstance = false
Me.EnableVisualStyles = true
Me.SaveMySettingsOnExit = true
Me.ShutDownStyle =
Global.Microsoft.VisualBasic.ApplicationServices.Shutdow
nMode.AfterMainFormCloses
EndSub

If i create a brand new application, just as a test and drop the two
controls into that, they appear with visual styles.

So it looks like its something to do with my project, but i can't find
out where or why.

any help appreciated.

Cheers

Nig

Author
18 Aug 2006 1:56 PM
Patrice
In your test application what are the controls you tried ? In particular
make sure you don't confuse menubar,toolbar with menustrip/toolstrip...

--
Patrice

<nkarn***@googlemail.com> a écrit dans le message de news:
1155906111.502415.243***@h48g2000cwc.googlegroups.com...
Show quoteHide quote
> My application seems to be ignoring Enable XP visual styles, which is
> ticked on in the application properties.
>
> the Toolbar and Menubar, which appear the nice looking shaded blue
> appear like that whilst in the IDE, but when I run the app, they both
> go to boring grey.
>
> In the application.designer.vb self generated file, it does have
> PublicSubNew()
> MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.Authent
> icationMode.Windows)
> Me.IsSingleInstance = false
> Me.EnableVisualStyles = true
> Me.SaveMySettingsOnExit = true
> Me.ShutDownStyle =
> Global.Microsoft.VisualBasic.ApplicationServices.Shutdow
> nMode.AfterMainFormCloses
> EndSub
>
> If i create a brand new application, just as a test and drop the two
> controls into that, they appear with visual styles.
>
> So it looks like its something to do with my project, but i can't find
> out where or why.
>
> any help appreciated.
>
> Cheers
>
> Nig
>
Author
18 Aug 2006 10:50 PM
tommaso.gastaldi
If you change the Start up form, does the error go away?

Tommaso

nkarn***@googlemail.com ha scritto:

Show quoteHide quote
> My application seems to be ignoring Enable XP visual styles, which is
> ticked on in the application properties.
>
> the Toolbar and Menubar, which appear the nice looking shaded blue
> appear like that whilst in the IDE, but when I run the app, they both
> go to boring grey.
>
> In the application.designer.vb self generated file, it does have
> PublicSubNew()
> MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.Authent
> icationMode.Windows)
> Me.IsSingleInstance = false
> Me.EnableVisualStyles = true
> Me.SaveMySettingsOnExit = true
> Me.ShutDownStyle =
> Global.Microsoft.VisualBasic.ApplicationServices.Shutdow
> nMode.AfterMainFormCloses
> EndSub
>
> If i create a brand new application, just as a test and drop the two
> controls into that, they appear with visual styles.
>
> So it looks like its something to do with my project, but i can't find
> out where or why.
>
> any help appreciated.
>
> Cheers
>
> Nig
Author
19 Aug 2006 4:24 AM
gene kelley
On 18 Aug 2006 06:01:51 -0700, nkarn***@googlemail.com wrote:

Show quoteHide quote
>My application seems to be ignoring Enable XP visual styles, which is
>ticked on in the application properties.
>
>the Toolbar and Menubar, which appear the nice looking shaded blue
>appear like that whilst in the IDE, but when I run the app, they both
>go to boring grey.
>
>In the application.designer.vb self generated file, it does have
>PublicSubNew()
>MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.Authent
>icationMode.Windows)
>Me.IsSingleInstance = false
>Me.EnableVisualStyles = true
>Me.SaveMySettingsOnExit = true
>Me.ShutDownStyle =
>Global.Microsoft.VisualBasic.ApplicationServices.Shutdow
>nMode.AfterMainFormCloses
>EndSub
>
>If i create a brand new application, just as a test and drop the two
>controls into that, they appear with visual styles.
>
>So it looks like its something to do with my project, but i can't find
>out where or why.
>
>any help appreciated.
>
>Cheers
>
>Nig

"Shaded Blue" implies to me, a blue gradient.  If that's the case, I'm curious as to what default
condition produces a blue gradient in design.

The most common way to reproduce what you desescribe if there is a default gradient on a toolstrip
in design is a line of code at runtime that references the ToolStrip's BackColor property.  With
VisualStyles, for the default gradient to display, the BackColor is Nothing, not
SystemColors.Control which is usually grey in most cases.

Gene