Tech Off Thread

7 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Windows forms controls dont use XP look

Back to Forum: Tech Off
  • User profile image
    JParrish

    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.

  • User profile image
    JParrish

    Nevermind.. answered my own post.. yes it was indeed my own ignorance..

    Found an article on MSDN

  • User profile image
    jkirwan

    I built a quick VS add-on which enables visual styles for winforms. You may find it helpful as well.

  • User profile image
    JParrish

    Awesome, thanks! Not sure why MS left this out of the product. Would seem that they would want devs to show off XP where possible. Luckily they made the plugin architecture =)

  • User profile image
    JParrish

    In the recent screenshots of win form 2.0 controls, they addressed this issue. Glad to see it =D

    http://www.windowsforms.net/WhidbeyFeatures/default.aspx?PageID=2&ItemID=6&Cat=Runtime&tabindex=4

  • User profile image
    Axyun

    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?

  • User profile image
    JParrish

    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?

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.