473,386 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

EnableVisualStyles in 2003?

Hello,

I'm using Visual Studio 2003 and it would be nice if my buttons and other
controls could look like Windows XP buttons rather than the flat square
kind. I looked on the web and found some info on
Application.EnableVisualStyles, but I'm not seeing much indication that 2003
supports it. Does it? And if so, how does it work?

Apr 11 '07 #1
7 1200
Peter wrote:
I'm using Visual Studio 2003 and it would be nice if my buttons and other
controls could look like Windows XP buttons rather than the flat square
kind. I looked on the web and found some info on
Application.EnableVisualStyles, but I'm not seeing much indication that 2003
supports it. Does it? And if so, how does it work?
I'm not sure if this is supported in VS 2003. In VS 2005 (including
the Express versions) you'd open the menu Project YourProjectName
Properties and would check "Enable Xp visual styles" in the
Application tab.

As a last resource, you could go the manifest route (sigh):

<link>
http://www.vbaccelerator.com/home/Vb...VB/article.asp
</link>

(beware of word wrap)

HTH.

Regards,

Branco.

Apr 11 '07 #2
"Peter" <st*****@hotmail.comschrieb:
I'm using Visual Studio 2003 and it would be nice if my buttons and other
controls could look like Windows XP buttons rather than the flat square
kind. I looked on the web and found some info on
Application.EnableVisualStyles, but I'm not seeing much indication that
2003 supports it. Does it? And if so, how does it work?
Yes, it's supported. Adapt your 'Sub Main' to look similar to this one:

\\\
Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MainForm())
End Sub
///

Note that Windows XP visual styles must be enabled in Windows in order to
see the difference.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Apr 11 '07 #3
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:uE**************@TK2MSFTNGP06.phx.gbl...
>
Yes, it's supported. Adapt your 'Sub Main' to look similar to this one:

\\\
Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MainForm())
End Sub
///
....and controls with a FlatStyle property must be set to FlatStyle.System.

For Buttons this means no Image, but you'll find sourcecode for a
replacement Button on my site:
http://www.dotnetrix.co.uk/buttons.html

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
Apr 11 '07 #4
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:uE**************@TK2MSFTNGP06.phx.gbl...
"Peter" <st*****@hotmail.comschrieb:
>I'm using Visual Studio 2003 and it would be nice if my buttons and other
controls could look like Windows XP buttons rather than the flat square
kind. I looked on the web and found some info on
Application.EnableVisualStyles, but I'm not seeing much indication that
2003 supports it. Does it? And if so, how does it work?

Yes, it's supported. Adapt your 'Sub Main' to look similar to this one:

\\\
Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MainForm())
End Sub
Thanks for the tip... although that does not work for me. It says
'EnableVisualStyles is not a member of System.Windows.Forms.Application.'

Apr 12 '07 #5
Peter wrote:
"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:uE**************@TK2MSFTNGP06.phx.gbl...
>"Peter" <st*****@hotmail.comschrieb:
>>I'm using Visual Studio 2003 and it would be nice if my buttons and
other controls could look like Windows XP buttons rather than the
flat square kind. I looked on the web and found some info on
Application.EnableVisualStyles, but I'm not seeing much indication
that 2003 supports it. Does it? And if so, how does it work?

Yes, it's supported. Adapt your 'Sub Main' to look similar to this
one: \\\
Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MainForm())
End Sub

Thanks for the tip... although that does not work for me. It says
'EnableVisualStyles is not a member of
System.Windows.Forms.Application.'
You're sure you're using VS2003 and not VS2002? According to the help
(q.v.), System.Windows.Forms.Application.EnableVisualStyle s was introduced
with .NET 1.1.

Andrew
Apr 12 '07 #6
"Andrew Morton" <ak*@in-press.co.uk.invalidwrote in message
news:Ol*************@TK2MSFTNGP05.phx.gbl...
Peter wrote:
>"Herfried K. Wagner [MVP]" <hi***************@gmx.atwrote in message
news:uE**************@TK2MSFTNGP06.phx.gbl...
>>"Peter" <st*****@hotmail.comschrieb:
I'm using Visual Studio 2003 and it would be nice if my buttons and
other controls could look like Windows XP buttons rather than the
flat square kind. I looked on the web and found some info on
Application.EnableVisualStyles, but I'm not seeing much indication
that 2003 supports it. Does it? And if so, how does it work?

Yes, it's supported. Adapt your 'Sub Main' to look similar to this
one: \\\
Public Sub Main()
Application.EnableVisualStyles()
Application.DoEvents()
Application.Run(New MainForm())
End Sub

Thanks for the tip... although that does not work for me. It says
'EnableVisualStyles is not a member of
System.Windows.Forms.Application.'

You're sure you're using VS2003 and not VS2002? According to the help
(q.v.), System.Windows.Forms.Application.EnableVisualStyle s was introduced
with .NET 1.1.
Well, by cracky, I thought I was using 2003. Guess it IS 2002. Don't I feel
the perfect fool.

Apr 13 '07 #7
Peter wrote:
>You're sure you're using VS2003 and not VS2002? According to the help
(q.v.), System.Windows.Forms.Application.EnableVisualStyle s was
introduced with .NET 1.1.

Well, by cracky, I thought I was using 2003. Guess it IS 2002. Don't
I feel the perfect fool.
You've been working too hard... backup your computer and then have a few
days off :-)

Andrew
Apr 13 '07 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: #ROBERT | last post by:
(VS 2003 + .NET Framework 1.1 + WinXP Pro SP2) Calling Application.EnableVisualStyles() after the initialization() removes all images in the tab control (in the tab headers I mean). Without...
9
by: Guy | last post by:
I have extended the datetimepicker control to incorporate a ReadOnly property. I have used the new keyword to implement my own version of the value property, so that if readonly == true then it...
1
by: desa | last post by:
If I call EnableVisualStyles none the images in my ImageLists show up in my controls anymore. Is this a known issue? How do I fix this? I'm using VS.NET 2003.
4
by: Christian Westerlund | last post by:
Hi! I usually enable visual styles in my apps. I do it in Main before I start my app with Application.Run. Today when I changed from debug to release mode in Visual Studio .NET 2003, the...
5
by: Stephan Schaem | last post by:
How does one write an unmanaged function that perform this functionality? In short I want to turn off/on visual style in my app... Thanks, Stephan PS: two people have been looking for...
17
by: Lance | last post by:
I've noticed that calling DoEvents is much slower in an application that has called Application.EnableVisualStyles in Sub Main. Furthermore, the performance seems to worsen each time that DoEvents...
4
by: Skysurfer | last post by:
Hi. I made a simple VB.Net 2003 application in which i have one Module with the Sub Main and two forms with un button in each one. I run the application on Windows XP Professional. This is...
2
by: Juan Pedro Gonzalez | last post by:
I am a bit unsure about this "Effect"... My code: Public Sub Main() Application.EnableVisualStyles() Application.DoEvents() Dim myMainForm As New FormularioPrincipal Dim mySplash As New...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.