.net 2.0 visual style
-
Hi, I am using winforms .net 2.0 It seems that the visualStyle does not have any effect on the controls looks. for example a button looks as if you are using .net 1.0 Any thoughts please?
There are several ways to get there: * * 1. * call Application.EnableVisualStyles(); just before * Application.Run(f); * disadvantages: * - this method does not exist under .NET 1.0 * - this method has a bug, causing later some ShowDialogs to throw a * SEHException * e.g. when using a ContextMenu on a NotifyIcon * * 2. * create a manifest file with a specific name (.exe.manifest) and put it * in the directory containing the exe file itself. The fixed content must be: * .NET control deployment tool * * 3. * create an instance of a special class before creating any of the intended * forms, as in: * using (new LP_EnableTheming(true)) { myForm form=new myForm(); form.CreateControl(); // can be included in myForm constructor ! Application.Run(form); } */ The special class is inspired on the article at http://www.codeproject.com/useritems/ThemingInScope.asp :) Luc Pattyn -- modified at 14:12 Wednesday 27th December, 2006
-
There are several ways to get there: * * 1. * call Application.EnableVisualStyles(); just before * Application.Run(f); * disadvantages: * - this method does not exist under .NET 1.0 * - this method has a bug, causing later some ShowDialogs to throw a * SEHException * e.g. when using a ContextMenu on a NotifyIcon * * 2. * create a manifest file with a specific name (.exe.manifest) and put it * in the directory containing the exe file itself. The fixed content must be: * .NET control deployment tool * * 3. * create an instance of a special class before creating any of the intended * forms, as in: * using (new LP_EnableTheming(true)) { myForm form=new myForm(); form.CreateControl(); // can be included in myForm constructor ! Application.Run(form); } */ The special class is inspired on the article at http://www.codeproject.com/useritems/ThemingInScope.asp :) Luc Pattyn -- modified at 14:12 Wednesday 27th December, 2006
Luc Pattyn wrote:
The above got dammaged (all less/greater than signs got interpreted; I need an extra HTML command ?!)
You need to check "Ignore HTML tags in this message" to keep the board from eating them.
-- Rules of thumb should not be taken for the whole hand.
-
Luc Pattyn wrote:
The above got dammaged (all less/greater than signs got interpreted; I need an extra HTML command ?!)
You need to check "Ignore HTML tags in this message" to keep the board from eating them.
-- Rules of thumb should not be taken for the whole hand.
Thanks Dan.
Luc Pattyn
-
Hi, I am using winforms .net 2.0 It seems that the visualStyle does not have any effect on the controls looks. for example a button looks as if you are using .net 1.0 Any thoughts please?
The visual style for all of the .NET frameworks is what the machine is currently using. With XP for example, their are 3 visual styles: luna, metallic, and homestead. All of the .NET frameworks (as long as the code or manifest files are provided in the application) will use the visual style specified. The main differences in the UI between .NET 1.1 and .NET 2.0 would have to be the new ToolStrip, MenuStrip, and ContextStrip which are still dependent on the visual style (if render property is system defined). The strips which have replaced the menus and toolbars of .NET 1.x have a newer appearance that can only be used on systems with the .NET 2.0 framework installed. This new appearance will help in giving your application an interface similar to that of Office 2000-2003.
Regards, Thomas Stockwell Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. Visit my homepage Oracle Studios[^]