XP Style controls??

W

WayneD

Hello,
I'm new to .NET but have been using VC++ 7.0 for quite a while. When you
create a C++ MFC application, you get a wizard dialog that has a check box
for "Common Control Manifest" which gives you the XP style buttons by adding
some stuff to the resource. When creating a Windows Application in C# I
can't find an equivalently convenient way to do it. Is there one? Or do I
have to manually edit all that XML gobbledygook in a manifest file? I
thought we were moving foward...
Thanks for any help,
Wayne
 
M

Miha Markic

Hi,

In main method call
Application.EnableVisualStyler();
Application.DoEvents():

Set button's FlatStyle to System.
There you go.

Miha/RightHand Consulting
 
W

WayneD

Thanks for the reply Miha,
Is EnableVisualStyler a C# thing? I couldn't find any documentation about it
and doesn't seem to be a member of the Application object. Also, I'm looking
for a way to turn on the XP Style for ALL controls in my app in one shot
rather than specifying it for each button or any other control. Anyone know
of an easy way??
Thanks again,
Wayne
 
M

Miha Markic

Hi Wayne,

My typo - it should be Application.EnableVisualStyles() (not s insted of r
at the end)
I've forgot to mention that the method is present only on .NET 1.1
Are you still using 1.0/VS.NET 2002?

Miha/RightHand Consulting
 
E

Eric Cadwell

If you're on 1.0 you have to use the manifest:

<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls"
version="6.0.0.0" processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df" language="*" />

HTH;
Eric Cadwell
http://www.origincontrols.com
 
W

WayneD

How do I get the manifest into a resource so I don't have to distribute the
separate file??
Thanks,
Wayne
 
S

Stu Smith

I'd suggest you don't use this method -- it's essentially broken (if it
wasn't, why would it require DoEvents() afterwards?). Save yourself some
grief and use a manifest file.
 
G

Guinness Mann

I'd suggest you don't use this method -- it's essentially broken (if it
wasn't, why would it require DoEvents() afterwards?). Save yourself some
grief and use a manifest file.

I can't comment on whether it's broken or whether the manifest is
better, but I can tell you that the call to DoEvents is unnecessary if
the call to EnableVisualStyles is the call immediately preceding the
call to Application.Run.

-- Rick
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,218
Latest member
JolieDenha

Latest Threads

Top