Click to See Complete Forum and Search --> : XP styles in .NET project


reptile
November 24th, 2003, 05:46 PM
Some day, I decided to test something on a .NET project. I wondered, that I couldn't find how to use XP visual styles in .NET project. Sometimes it seems to me, that all components, I mean controls, those are used in .NET projects are just standard activeX components, that I've been using in MFC applications (microsoft Form 2.0, microsoft command button 2.0, etc ). Is it real, and please tell is it possible to use XP visual styles in .NET projects, and if yes please tell how???

Thanx for your attention.

marchel
November 25th, 2003, 09:47 AM
In order to get XP visual styles basically you need to add manifest to your project. The details how to do it are described in the Microsoft article:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchUsingWindowsXPVisualStylesWithControlsOnWindowsForms.asp

Jack

marchel
November 25th, 2003, 09:52 AM
Sorry, somehow link got scrambled in my previous post. Try this again:

"http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchUsingWindowsXPVisualStylesWithControlsOnWindowsForms.asp"

Jack

vicodin451
November 25th, 2003, 09:55 AM
Originally posted by marchel
Sorry, somehow link got scrambled in my previous post. Try this again:

"http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchUsingWindowsXPVisualStylesWithControlsOnWindowsForms.asp"

Jack
Actually, the first link works better than this one. CG "pretties" long URLs. The URL in the post above displays a space that will need to be edited when one pastes the URL into the browser.

marchel
November 25th, 2003, 09:57 AM
I know what is wrong !
The link is somehow reformatted when I'm posting this answer.
It looks good in preview but gets scrambled with extra fromating characters when posted.

Try to build the link from the four pieces below:

"http://msdn.microsoft.com/library/default.asp?url="
"/library/en-us/dv_vstechart/html/"
"vbtchUsingWindowsXPVisualStyles"
"WithControlsOnWindowsForms.asp"

Build one long line form the four text lines above that
are between "" characters (do not include "" characters of course). Also do not use any spaces.

That should work.

Jack

vicodin451
November 25th, 2003, 10:04 AM
Originally posted by marchel
I know what is wrong !
The link is somehow reformatted when I'm posting this answer.
It looks good in preview but gets scrambled with extra fromating characters when posted.

Try to build the link from the four pieces below:

"http://msdn.microsoft.com/library/default.asp?url="
"/library/en-us/dv_vstechart/html/"
"vbtchUsingWindowsXPVisualStyles"
"WithControlsOnWindowsForms.asp"

Build one long line form the four text lines above that
are between "" characters (do not include "" characters of course). Also do not use any spaces.

That should work.

Jack

The very first link is fine. Click on it and let it take you to the page. As I stated before, CG "pretties" the display of long URLs - the actual link is preserved, but what is displayed appears with an ellipsis in the midst of the beginning and end of the actual URL text.

marchel
November 25th, 2003, 10:22 AM
Originally posted by vicodin451
The very first link is fine. Click on it and let it take you to the page. As I stated before, CG "pretties" the display of long URLs - the actual link is preserved, but what is displayed appears with an ellipsis in the midst of the beginning and end of the actual URL text.

Well, %20 is not in the ellipsis :-) but you are right, that if one edits extra inserts, the original link works. Anyway I was originally confused so I asumed, more readers can be confused. The last version at least should take the any user to the right article.

marchel
November 25th, 2003, 10:36 AM
Originally posted by reptile
Some day, I decided to test something on a .NET project. I wondered, that I couldn't find how to use XP visual styles in .NET project. Sometimes it seems to me, that all components, I mean controls, those are used in .NET projects are just standard activeX components, that I've been using in MFC applications (microsoft Form 2.0, microsoft command button 2.0, etc ). Is it real, and please tell is it possible to use XP visual styles in .NET projects, and if yes please tell how???

Thanx for your attention.

I also forgot to add. The process of adding manifest is not very user friendly, rather tedious (although not that difficult). If you don't care that much about .NET, but want to easily create RAD applications for Win32 and have a slick solution to add XP styles to your project, try Borland Delphi 7. You might like it. As an extra you are going to have fully compiled executable. Also many users consider Delphi VCL framwork as "better" than .NET for whatever "better" means :-) There are some rumors, that Delphi 8 will have .NET included. The only "donwside" is that Delphi is object oriented Pascal. It is a nice language but rather forgotten today. Not that difficult to learn if you don't already know it.

Do not try Borland C++ Builder (v6). VCL built into it does not support XP visual styles and the Builder itself is dead. Version 6 is the last version of this product. The new C++BuilderX is complete junk at this moment.

Jack

vicodin451
November 25th, 2003, 10:41 AM
Hmmm...
I never realized how broken the CG/vB url mechanism really was.
Sigh.
I just can't seem to be able to get CG/vB to display the correct URL.

Groan...

reptile
November 25th, 2003, 06:18 PM
Thanx a lot for your link, I've got MSDN July, and I've found that it doesn't contain this theme. Like in a movie.

> try Borland Delphi 7
I've gotta mention, that in the country where I live a great part of all programmers is fond of Delphi, and only fewer one programming on C#, C++.
I know Pascal, and basics of Windows programming, so I think I could have learned Delphi in short times very easyly.
But now, I like C++, and going to learn to fully use it to develop nice applications.
Anyway, thanx for your advice MARCHEL.

reptile
November 28th, 2003, 05:30 PM
Oh excuse me please. My MSDN was bad. The problem was in a disk.
By the way, there is an easier way to use WinXP visual styles in .NET project. Just use

System.Windows.Forms.Application.EnableVisualStyles();
(System::Windows::Forms::Application::EnableVisualStyles(); in C++ )

before the main function, and gotcha. Your project supports new XP visual styles.

Thanx for attention.

P.S. This method hasn't been tested on Visual Studio .NET (2002),
but it was so in Visual Studio 2003.