views:

140

answers:

2

I created an Interop user control in VS2005. When the user control is shown inside VB6, it does not pickup/use the XP styles (The buttons and the tabs look like VB6 buttons/tabs).

How do I get the XP styles to work with my control while it is in VB6?

+1  A: 

you need to add a manifest file for the application, add a file with the name {exefilename}.exe.manifest to the same folder as the application.

Marioh
That remember me old souvenir about VB6 and XP :)
Daok
A: 

The manifest file only works for earlier versions of .net and after .net 1.1 you can activate them programmatically. I had to add the line Application.EnableVisualStyles() in the default constructor of the interop user control.

Public Sub New()
    Application.EnableVisualStyles() '-- I added this line
    ' This call is required by the Windows Form Designer.
    InitializeComponent()
    ' Add any initialization after the InitializeComponent() call.
    'Raise Load event
    Me.OnCreateControl()
End Sub

Here is Microsoft's post on Application.EnableVisualStyles that explains everything.


@marioh - thanks for the response.

Maudite