JDYoder Posted July 12, 2007 Posted July 12, 2007 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? Quote
MrPaul Posted July 12, 2007 Posted July 12, 2007 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: Quote Never trouble another for what you can do for yourself.
JDYoder Posted July 13, 2007 Author Posted July 13, 2007 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! Quote
techmanbd Posted July 16, 2007 Posted July 16, 2007 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. Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
JDYoder Posted July 16, 2007 Author Posted July 16, 2007 Yeah, I have MS 2005. Sorry to hear it's missing in 2003. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.