TX Text Control Blog

Enable visual styles in Visual Studio projects

Blogged by Björn Meyer on March 27, 2007 and tagged with visual studio, .net.

Since version 13.0 of TX Text Control, all toolbars support the Windows color schemes that can be selected through the system settings. This new design can be selected through the ColorScheme setting of the ButtonBar.ButtonStyle, ButtonBar.BorderStyle, RulerBar.BorderStyle and StatusBar.BorderStyle properties.

By default, the new border and button style is ColorScheme. If the visual styles are not enabled in the application, buttons, tree-views or any other controls do not use the style.

The Application.EnableVisualStyles method enables these styles for the complete application. The visual styles will be used, if the control and the operating system support them. This method must be called before the controls can be created.

Therefore, you simply need to insert one line of code into the Main() function:

[STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); }
 
 
User Contributed Note

User Contributed Note by Etion June 26, 2007 at 2:44:19 PM CEST

Thank you very much for this.
 

Products

Support

Downloads

Corporate

Buy Now