Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

VS 2005 WinForm Designer and 2003 control style

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
karlag92 - 22 Oct 2007 23:52 GMT
I am working to convert a VERY large application from VS2003 and .Net
1.1 to VS2005 and .Net 2.0.

While I have managed to build and run my application successfully, the
windows forms designer shows the New style flat controls and not the
old style 3D controls.

While I like the asethetics of the new style, it is not practical for
my small team to switch to the flat style and go through the MASSIVE
amount of control reformatting this would entail.

However, if we can't see what we're going to get in the WinForms
designer, it will make VS 2005 effectively unuseable.

Question 1:  At runtime, how does it know to display controls in the
old style?

Question 2:  Surely the designer can show the controls in the format
they will appear when run.  How do I set this?

Thank you in advance for any help you can provide.
karlag92 - 25 Oct 2007 23:07 GMT
> I am working to convert a VERY large application from VS2003 and .Net
> 1.1 to VS2005 and .Net 2.0.
[quoted text clipped - 17 lines]
>
> Thank you in advance for any help you can provide.

ANSWER to Question 1:  At runtime you have to specify for the
application to be ABLE display the new visual styles.  Do this by
calling this method before any forms are created:
Application.EnableVisualStyles();

The application will then use the visual styles specified in the
Windows settings.

There is also this command,
Application.SetCompatibleTextRenderingDefault(false), but it caused
very undesireable results in my application.  So you can either omit
it, or call it passing true.

ANSWER to Question 2:  The designer displays using the Visual Style
you have specified on your Windows XP settings, so if you turn off
Windows XP style controls on your development machine, it will display
the controls "the old fashioned way".  I have not yet found a way to
have it display AS IF the EnableVisualStyles had not been called so I
can leave my desktop alone.  I do not like this "solution" so far, so
if anyone can tell me how to have the designer simulate disabling
visual styles, please add to this posting . . .

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.