CSharp/C# >> C# with XP look

by Wndr » Fri, 10 Oct 2008 01:52:38 GMT

Hi guys.
I am newbie in C#.
I have a project written in MS VisualStudio 2008, C#. So when I execute the
project (Windows Forms Application) on the same machine when MSVS2008
installed the form style I get is XP, but when I run same exe on machine
that doesn't have this installed I get old look style.
Does any one have an idea on if it's possible to be able to have XP look on
any machine, regardless if MSVS2008 installed or not, and how.
Thanks in advance.



CSharp/C# >> C# with XP look

by Duggi » Fri, 10 Oct 2008 02:09:46 GMT



investigate on EnableVisualStyles() ...

However if you want it to be look like XP style in other OS / older OS
than XP, I think it is hard.. you may need to include all the imanges
in the resources...

-Cnu

-Cnu

CSharp/C# >> C# with XP look

by Hillbilly » Fri, 10 Oct 2008 03:03:26 GMT

Yes, EnableVisualStyles() is the classic (but old) way of managing a Windows
UI and should be learned first but the big picture in this context of the UI
is now all about using the classes in the Windows Presentation Foundation
(WPF).

CSharp/C# >> C# with XP look

by xcal » Fri, 10 Oct 2008 05:58:16 GMT

but, can XP use WPF?



Windows
UI


MSVS2008

CSharp/C# >> C# with XP look

by Peter Duniho » Fri, 10 Oct 2008 11:07:56 GMT


Yes, of course.

CSharp/C# >> C# with XP look

by Wndr » Fri, 10 Oct 2008 23:39:10 GMT

Where could I get these Windows Presentation Foundation classes?

CSharp/C# >> C# with XP look

by Jon Skeet [C# MVP] » Fri, 10 Oct 2008 23:49:16 GMT


They're part of .NET 3.0.

--
Jon Skeet - < XXXX@XXXXX.COM >
Web site: http://www.pobox.com/ ~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com

CSharp/C# >> C# with XP look

by Wndr » Sat, 11 Oct 2008 04:51:46 GMT

Hi. I installed .Net Framework 3.0 and 3.5 and still don't get the gui I get
on another machine.
Both machines XP SP2, both have .Net 3.0 and 3.5, the only difference is one
has MSVStudio 2008 and another MSVS2005, so is there any way when I compile
my project in VS2008 with all this nice gui to see the same look on machine
that has VS 2005?
Thanks

CSharp/C# >> C# with XP look

by Peter Duniho » Sat, 11 Oct 2008 08:07:52 GMT


WPF is an API in .NET. Either you're using it, or you're not. Upgrading
to a new version of .NET doesn't automatically cause your previous non-WPF
applications to all of the suddenly start using WPF.

CSharp/C# >> C# with XP look

by Jon Skeet [C# MVP] » Sun, 12 Oct 2008 02:20:21 GMT


What exactly do you mean? WPF is an API you program against -
installing it won't turn change any existing programs.


Could you put screenshots of the two views onto a website somewhere? Is
it possible that you've just got a different theme on one of your
boxes?

--
Jon Skeet - < XXXX@XXXXX.COM >
Web site: http://www.pobox.com/ ~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com

CSharp/C# >> C# with XP look

by Todd Carnes » Sun, 12 Oct 2008 03:49:11 GMT


Just because WPF is available, doesn't automatically mean it's the best
choice all the time. Actually, I haven't seen where WPF is all that great
myself, but that's just my own personal opinion. I have no burning desire to
learn yet another way to create a window, when the way I already know, is
easy and gets the job done just fine.

Todd

CSharp/C# >> C# with XP look

by harborsparrow » Sun, 12 Oct 2008 12:53:55 GMT

Here's how to get it if the OS can do it:

// enable XP theming ("visual styles") if newer OS and
feature available
if ((Environment.OSVersion.Version.Major >= 5) &&
(Environment.OSVersion.Version.Minor > 0))
{
if (OSFeature.Feature.IsPresent(OSFeature.Themes))
{
Application.EnableVisualStyles();
}
}

CSharp/C# >> C# with XP look

by Jon Skeet [C# MVP] » Wed, 15 Oct 2008 03:04:57 GMT


Okay - if you run any other applications (e.g. Notepad) on the two
boxes, do they both look the same? My guess is that it's just the
display settings for the machines.

--
Jon Skeet - < XXXX@XXXXX.COM >
Web site: http://www.pobox.com/ ~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com

CSharp/C# >> C# with XP look

by Wndr » Wed, 15 Oct 2008 03:39:34 GMT

No they look different.
I think you are right, but what should I change on machine?
Thank you.

CSharp/C# >> C# with XP look

by Jon Skeet [C# MVP] » Wed, 15 Oct 2008 04:27:30 GMT


I don't know - I don't have XP any more. But it'll be somewhere in
display properties.

--
Jon Skeet - < XXXX@XXXXX.COM >
Web site: http://www.pobox.com/ ~skeet
Blog: http://www.msmvps.com/jon.skeet
C# in Depth: http://csharpindepth.com

Similar Threads

1. looking for vcl to make control looks like XP - Borland C++ Builder VCL Components

2. XP look and feel in C# app

Hi,

I want to have XP style controls in my C# app. I created the manifest
file in my app folder that looks like this.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1"
manifestVersion="1.0">
  <assemblyIdentity
      version="1.0.0.0"
      processorArchitecture="X86"
      name="Microsoft.Windows.SysInfo"
      type="win32"
/>
  <description>Your app description here</description>
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
          type="win32"
          name="Microsoft.Windows.Common-Controls"
          version="6.0.0.0"
          processorArchitecture="X86"
          publicKeyToken="6595b64144ccf1df"
          language="*"
        />
    </dependentAssembly>
  </dependency>
</assembly>

When I try to build, I get an error:

Error	14	Could not find file 'Microsoft.Windows.Common-Controls,
Version=6.0.0.0, Culture=*, PublicKeyToken=6595b64144ccf1df,
ProcessorArchitecture=X86, Type=win32'.	MyApp

I tried adding reference to comctl32.dll and it says the assembly is
not valid. Am I missing something?

Thanks,
Avanti

3. Windows Xp look for C# application. - CSharp/C#

4. XP like Look n Feel in Window Application (C#)

Hello Everybody,
I am doing project in which C# is Front-End. Projetc is Desktop Application.
And I want to give XP like Look n Feel to all controls & form of
Application. This look n feel must work on previous edition of Windows Like
(98,2000,ME,WINNT).
I want apply this look n feel to controls loke
Tabs,Toolbar,Form,Radio,CheckBox,Button,
DataGrid,Menu etc.
Please help me in this regard.


5. xp look and feel for winforms controls in non xp-based systems - .Net Framework

6. XP Look and feel in VSC#.NET

How can I get the Win XP look and feel in Visual Studio C# .NET? I have
tried the MSDN example with the manifest file, but it doesn't seem
to help.

7. Windows XP look n Feel - CSharp/C#

8. Getting XP Style look and feel

How do i get XP Style look and feel for Controls in C# 
window application. All the controls i am using are Custum 
controls designed by inheriting .NET Common controls.