EFileTahi-A Posted July 8, 2005 Posted July 8, 2005 I truly don't understand why .NET "so-used" controls like a button don't have included on its "appearance" options the possibility to turn them into WinXP styled buttons. How can I make them look like WinXP buttons? I searched the web and a found some controls to do this, some are freeware others are not, still, I would like to know if there is a way doing this, skiping the need of instaling addional controls... Quote
lidds Posted July 8, 2005 Posted July 8, 2005 Have a look at this post http://www.xtremedotnettalk.com/showthread.php?t=91467&highlight=styles I asked the same question. By the way I ended up using DotNetBar from devcomponents.com you have to pay for it but it was the best value for money. Hope that helps. Simon Quote
EFileTahi-A Posted July 8, 2005 Author Posted July 8, 2005 Well, what can I say, it works damn great! Thank you very much for your post lidds! - THREAD CLOSED - Quote
EFileTahi-A Posted July 8, 2005 Author Posted July 8, 2005 - THREAD RE-OPENED - Ok, I have this prob, Application.EnableVisualStyles cease to work for some good reason, all my controls no longer have the WinXP look. I truly don't understand why, I made a new project to test the EnableVisualsStyles and it works fine, but in some other project of mine, (the one in which I first tryed the VisualStyles) stopped working. The Applcation.EnableVisualStyles Is emidiately behind the Run Application Method as it was always. Yet I confirmed all the controls (buttons) FlatStyle if they were set to "System". Any ideias? I can't post any code since I'm at home at the momment, yet, what kind of code woud it to be required (if actually necessary)? Quote
techmanbd Posted July 8, 2005 Posted July 8, 2005 After Application.EnableVisualStyles put Application.doevents It seems when you start increasing controls it stops working. But put the doevents in between the Application.EnableVisualStyles and Run and it works Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
decrypt Posted July 8, 2005 Posted July 8, 2005 If that doesn't work, you can always use this alternative: Set each control with a FlatStyle property to FlatStyle.System Create a manifest file to bind your app to comctl6. The sample manifest file below can be used to bind any app (managed or unmanaged) to comctl6. Just copy it to the location of the .exe and rename it to <app name>.exe.manifest. You must then add a Win32 resource to your application. This is accomplished by first opening up the *.exe. 1. Open your exe in VS (file -> open file) 2. Right click on it and select add resource 3. Click "Import..." from the dialog 4. Select your manifest file 5. In the "Resource Type" field, enter "RT_MANIFEST" 6. In the property grid, change the resource ID from "101" to "1". 7. Save the exe. 8. Make sure the manifest is keep at the same directory level as the executable. (In this How-To it is placed in the bin directory of the solution) Quote
EFileTahi-A Posted July 9, 2005 Author Posted July 9, 2005 The Application.DoEvents seems to have no effect on the problem :(, so am going to try Decrypt's method. Unfortunately I don't understand part of what he wrote: "Create a manifest file to bind your app to comctl6." What is / how can I do this? Quote
Wile Posted July 9, 2005 Posted July 9, 2005 Take a look at these articles, they also explain how to use a manifest file (but use a 32bits versil of the common control library ;) ) http://www.codeproject.com/vb/net/XPStyleB.asp http://www.codeproject.com/csharp/XPStyleUI.asp Doesnt matter if it is VB or C#, manifest works the same for all .net languages (they are handled by the framework, not the application). This is also why working with a manifest file has better results than using enablevisualstyles. The enablevisualstyles starts working after the application is created and might be to late (must be the first statement in the main method to have any chance) to do its 'magic'. The manifest file is loaded by the .net framework before loading the application, making sure all the 'magic' is done in time ;). Quote Nothing is as illusive as 'the last bug'.
decrypt Posted July 9, 2005 Posted July 9, 2005 yeah the application.enablevisualstyles causes a lot of problems with me when I do a selected index change on a listbox. Quote
EFileTahi-A Posted July 10, 2005 Author Posted July 10, 2005 Take a look at these articles, they also explain how to use a manifest file (but use a 32bits versil of the common control library ;) ) http://www.codeproject.com/vb/net/XPStyleB.asp http://www.codeproject.com/csharp/XPStyleUI.asp Doesnt matter if it is VB or C#, manifest works the same for all .net languages (they are handled by the framework, not the application). This is also why working with a manifest file has better results than using enablevisualstyles. The enablevisualstyles starts working after the application is created and might be to late (must be the first statement in the main method to have any chance) to do its 'magic'. The manifest file is loaded by the .net framework before loading the application, making sure all the 'magic' is done in time ;). Thank you very much wile! It is working once more! :D Quote
jmcilhinney Posted July 11, 2005 Posted July 11, 2005 I suggest you go to http://www.skybound.ca and download VisualStyles, which is a free component that overcomes pretty much all of the limitations of Visual Studio when it come to visual styles. There is no need for manifests, no need to change the FlatStyle or anything. It all just works with virtually no effort. Add the component to each form and your done. Quote
penfold69 Posted July 11, 2005 Posted July 11, 2005 I second jmcilhinney's suggestion - the Skybound control is far superior to Microsoft's "broken" implementation of XP Styles. B. 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.