【发布时间】:2014-07-18 16:07:17
【问题描述】:
我正在将 VB6 ActiveX Dll 转换为 VB.net。为了支持旧系统,我需要 COM 接口以与更新前相同的方式运行。
我有两个实例,其中 VB6 ColorConstant 作为 VB6 中的属性来回传递。
VB6
Public Property Let ProgressBarColor(color As ColorConstants)
userform.ProgressBarColor = color
End Property
Public Property Get ProgressBarColor() As ColorConstants
ProgressBarColor = userform.ProgressBarColor
End Property
这是我在 .Net 中的内容
VB.NET
Public Property ProgressBarColor() As Long
Get
userform.ProgressBarColor
End Get
Set(ByVal Value As Long)
ProgressBarColor = System.Drawing.ColorTranslator.FromOle(Value)
End Set
End Property
有没有办法让 VB.Net 将其作为颜色常数处理?
【问题讨论】:
-
你试过用
System.Drawing.Color常量代替颜色常量吗?