문제

VS2005에서 Interop 사용자 컨트롤을 만들었습니다. 사용자 컨트롤이 VB6 내부에 표시되면 XP 스타일을 픽업/사용하지 않습니다 (버튼과 탭은 vb6 버튼/탭처럼 보입니다).

XP 스타일이 VB6에있는 동안 내 컨트롤과 함께 작동하도록하려면 어떻게해야합니까?

도움이 되었습니까?

해결책 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.

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top