Vista buttons/controls

Add-in Express™ Support Service
That's what is more important than anything else

Vista buttons/controls
 
John Ja




Posts: 1
Joined: 2009-01-18
Hi, quick question,
When I load a form with one button from ADXOfficeRibbonMenu, the button doesn't look like it does in the designer (Vista "Look") but more like an XP button.

I assume I'm doing something wrong when creating the project.

Ideas?

Thanks,
John
Posted 18 Jan, 2009 12:18:04 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi John,

What button do you mean? Is it System.Windows.Forms.Button class on your custom form?

BTW You can try to use the System.Windows.Forms.Application.EnableVisualStyles() method in the constructor before the InitializeComponent.
.NET, Extended MAPI, Windows Phone & RT
Posted 19 Jan, 2009 12:48:47 Top
John J




Posts: 30
Joined: 2009-01-20
Thanks, Eugene.

The EnableVisualStyles() did the job. Still, any idea why I need to add this?
Posted 20 Jan, 2009 12:40:10 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Good news!

The MSDN library states the following:

This method enables visual styles for the application. Controls will draw with visual styles if the control and the operating system support it. To have an effect, EnableVisualStyles must be called before creating any controls in the application; typically, EnableVisualStyles is the first line in the Main function. A separate manifest is not required to enable visual styles when calling EnableVisualStyles.

You are welcome, John.
.NET, Extended MAPI, Windows Phone & RT
Posted 21 Jan, 2009 05:11:13 Top
John J




Posts: 30
Joined: 2009-01-20
Thanks, Eugene!
Posted 21 Jan, 2009 07:24:55 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25

You are welcome, John.
.NET, Extended MAPI, Windows Phone & RT
Posted 21 Jan, 2009 07:31:00 Top