sde Posted November 12, 2005 Posted November 12, 2005 it's been a while since i coded a windows form project. i vaugely remember a parameter in before the application loaded that enhanced the form to look more modern. any ideas? Quote codenewbie
georgepatotk Posted November 12, 2005 Posted November 12, 2005 I wish to help you. But, I don't know what exactly you want. Quote George C.K. Low
*Experts* DiverDan Posted November 12, 2005 *Experts* Posted November 12, 2005 If you looking for an XP look with VS2003 then in the main forms New sub located in the "Windows Form Designer generated code" region add the following. Application.EnableVisualStyles Application.DoEvents If you're using VS2002 then you'll need to wirte a manifest file. You'll get lots of examples from a Google search. I haven't used 2005 yet, but I understand that it automatically sets VisualStyles without any of the possible bugs that VS2002 and 2003 shared using the XP look. Also, you'll need to set your controls to System for the XP style. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
Leaders snarfblam Posted November 12, 2005 Leaders Posted November 12, 2005 To elaborate on DiverDan's post: It is recommended that EnableVisualStyles be called before your main form's constructor, to ensure that absolutely no controls are created before the call to EnableVisualStyles (otherwise, some controls may be bounds to the wrong version of Common Controls and display incorrectly). [Vb] 'In your main form's code Public Shared Sub Main() Application.EnableVisualStyles() Application.DoEvents() Application.Run(New Form1) 'Replace with your form's name End Sub [/code] Also, you'll need to set your controls to System for the XP style.[/Quote] This is done by setting the FlatStyle property to System. There is also a sample manifest in MSDN. Quote [sIGPIC]e[/sIGPIC]
sde Posted November 13, 2005 Author Posted November 13, 2005 thanks a lot. this is what i was looking for :) Quote codenewbie
*Experts* DiverDan Posted November 15, 2005 *Experts* Posted November 15, 2005 If you are using 2003 you might consider the manifest file over EnableVisualStyles as there are a few bugs with the EnableVisualStyles depending on your program that will cause your program to crash. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
mskeel Posted November 15, 2005 Posted November 15, 2005 Zing! To cover the topic once again.. I highly recommend the Skybound control mentioned in this post (and the post this post links to all on the same subject.) The manifest still has visual style bugs/problems with regards to rendering properly. You can find a link to that in the post above as well. Quote
*Experts* DiverDan Posted November 15, 2005 *Experts* Posted November 15, 2005 Good call mskeel, I forgot about Skybound as it works effortlessly without any of the visual style bugs, even on my monster program. Quote Member, in good standing, of the elite fraternity of mentally challenged programmers. Dolphins Software
techmanbd Posted November 15, 2005 Posted November 15, 2005 I have a simple question about Skybound. When using the skybound controls, does it only work using XP or does it work with 2000 as well? at work we are using W2K0 Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
mskeel Posted November 15, 2005 Posted November 15, 2005 Unfortunately, the style will depend on the machine you are running the application on. That goes for any technique you use, manifest file, skybound control, and so on. I'm pretty sure you'll have to look into skinning if you want XP themes on Win2000. 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.