XP的外观为VB6 Outlook Property Page?

时间:2009-06-24 00:18:01

标签: vb6 outlook

我正在使用VB6为Outlook编写PropertyPage。这是作为VB6 OCX实现的。

在XP(或更新版本)上运行较新版本的Outlook(如2007)时,我的对话框看起来很奇怪,因为它没有XP外观。有没有办法做到这一点?

最好不要为Outlook.exe添加清单文件。

4 个答案:

答案 0 :(得分:1)

我认为你避免使用清单是正确的。不幸的是,支持VB6的XP主题的standard众所周知的hacks依赖于清单。这篇关于developer solutions for Outlook 2007的MSDN文章警告说,为Outlook 2007提供自己的清单可能会导致它挂起。

答案 1 :(得分:0)

我认为你不能在VB6中做到这一点......那些控件看起来会像它们的样子。但是,您可以使用Visual Studio .NET和Visual Basic .NET创建属性页,并获得XP,2007和Vista的外观。这与你正在做的事情有点不同,但你真的落后于用VB6开发的时代。有关如何执行此操作的详细信息有hereoffice developer center

答案 2 :(得分:0)

我不知道使用VB6

如果你可以使用.NET - 一种方法是WPF。我之前看过代码项目的一个例子。 Here's the link

编辑:另一个帮助here

的工具

答案 3 :(得分:0)

这是我在所有VB6应用程序中所做的,只在独立的EXE中进行过测试,因此不确定它是否可以作为OCX使用。

Private Type tagInitCommonControlsEx
   lngSize As Long
   lngICC As Long
End Type
Private Declare Function InitCommonControlsEx Lib "comctl32.dll" _
   (iccex As tagInitCommonControlsEx) As Boolean
Private Const ICC_USEREX_CLASSES = &H200

Public Function InitCommonControlsVB() As Boolean
   On Error Resume Next
   Dim iccex As tagInitCommonControlsEx
   ' Ensure CC available:
   With iccex
       .lngSize = LenB(iccex)
       .lngICC = ICC_USEREX_CLASSES
   End With
   InitCommonControlsEx iccex
   InitCommonControlsVB = (Err.Number = 0)
   On Error Goto 0
End Function

Public Sub Main()
   InitCommonControlsVB

   '   
   ' Start your application here:
   ' 

End Sub

创建一个与此类似的文件:http://pastebin.com/f689388b2

然后将清单文件添加到资源文件中,类型为RT_MANIFEST(24)

我不记得你是否需要这样做,因为我现在总是只使用相同的预先制作的.res文件。

来源:http://www.vbaccelerator.com/home/vb/code/libraries/XP_Visual_Styles/Using_XP_Visual_Styles_in_VB/article.asp