Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I upgraded a simple VB6 app to VB.NET. It worked fine, but I found something odd. In the IDE, the controls (buttons and textboxes) look like they normally do in VB.NET. But when I run the program, they take on the VB6 appearance (square cornered buttons and shaded textboxes). This still happens if I add a new form into the newly converted project and add new controls onto it.

 

How can I make all the controls (converted and newly added) in a converted app appear like they do with a brand new VB.NET app at run-time?

Posted

Visual styles

 

I believe there are generally two ways of enabling visual styles - via a manifest file, or programmatically. I prefer the latter approach. In the Sub Main add the following line of code before any forms are shown:

 

Application.EnableVisualStyles()

 

This will enable visual styles for the application. If you're interested in the manifest approach, a search will probably yield some useful information.

 

Good luck :cool:

Never trouble another for what you can do for yourself.
Posted

Your post enabled me to find a better way to correct this. You mentioned it's at the app level, so I checked the project's properties. In the Application tab I saw "Enable XP Visual Styles" was checked, but grayed out. So I checked "Enabled Application Framework" above it and presto, it works! (I found that when making a new VB.NET app, that's automatically checked.)

 

So thanks for your help! It was driving me nuts!

Posted
Are you running 2005 version? 2003 I don't think has that as I looked around so I have to do what MrPaul said and also have to set the FlatStyle properties to "System", If I want to. But since we are still on Windows 2000,:mad: it doesn't work on it.
Live as if you were to die tomorrow. Learn as if you were to live forever.
Gandhi

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...