Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 347
  • Last Modified:

c# winforms application button are looking 'wrong'

Hi

I have just done a test-run to deploy the application I am developing on the end users machine.  Took a while to work out what was needed but got there in the end.

The application runs fine on the target machine (windows xp pro) but the buttons look wrong, they are of the old vb6 style, and have the same colour as whatever background they are placed on... weird... how can I get the 'nicer' vs2010 buttons to display?
0
cycledude
Asked:
cycledude
  • 4
  • 2
1 Solution
 
cycledudeAuthor Commented:
ah... could it be the windows setup preventing the 'modern' buttons..?  I notice the start menu is of the windows 98 'grey' varietyrather than the windows xp green...
0
 
Luis PérezSoftware Architect in .NetCommented:
Maybe your application is simply applying the current system theme.

Anyway, you can try this:
Application.EnableVisualStyles();

Put this line of code as the first executable line of your application.

Hope that helps.
0
 
cycledudeAuthor Commented:
thanks

I will try that ;o)
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
cycledudeAuthor Commented:
just had a look and it was already in there, along with :

Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new mdiMain());

Open in new window

0
 
Luis PérezSoftware Architect in .NetCommented:
Then you can't do anything. As I said, your application is applyng themes and standard styles, but in some computers those styles will tell the application to draw the controls in that old-looked style.
0
 
cycledudeAuthor Commented:
thanks

Not so much a solution but confirmation that there's nothing I can do about it.

Cheers
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now