Question

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?

Was it helpful?

Solution 2

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top