I am wondering why the windows forms controls don't obtain the look and feel of XP? I have recently started doing a lot of desktop development vs. my usual web/server development, and it is a little disheartening to see that the "widget" problem that affects
linux desktops is also affecting windows forms.
Can anyone from MS provide any insight into why basic controls like buttons, checkboxes, input fields, etc. all have a look from nearly 10 years ago? I am hoping that it is my ignorance and not a limitation of win forms.
Nevermind.. answered my own post.. yes it was indeed my own ignorance..
I posted this is another thread regarding XP visuals and controls but I have yet to receive a straight answer regarding the following:
The MSDN article talks about adding in a manifest file and all that other stuff but I can get XP visual styles to work in a much easier fashion and I've gotten it to work in multiple machines.
Using VS 2003, create a new Windows Application, find void Main() and right before Application.Run(new Form1()) type in Application.EnableVisualStyles(). Add some controls to the form and run the program. As long as your controls have the proper flat style
value (FlatStyle.System), they should render using Windows XP's control style.
I have yet to see why you should NOT use this method. You can also check that the user is running XP by checking Environment.OSVersion.
Does anyone have any insight into this?
I just tried it.. and as you said, everything renders as it should using the XP visual styles. I copied the binary over to my 2003 server and it ran there without incident using the "classic" widget look. So you pose a good question. Is it possible that
the article recommending adding the manifest was pre- VS.NET 2003?
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.