|
在程序中注册和注销 OCX 控件 声明(在本例子里使用的是 ComCtl32.OCX,如果是其他,使用相应的名称): Declare Function RegComCtl32 Lib "ComCtl32.OCX" _ Alias "DllRegisterServer" () As Long Declare Function UnRegComCtl32 Lib "ComCtl32.OCX" _ Alias "DllUnregisterServer" () As Long Const ERROR_SUCCESS = &H0
使用:
If RegComCtl32 = ERROR_SUCCESS Then MsgBox "Registration Successful" Else MsgBox "Registration Unsuccessful" End If
If UnRegComCtl32 = ERROR_SUCCESS Then MsgBox "UnRegistration Successful" Else MsgBox "UnRegistration Unsuccessful" End If
2.建立可下拉选择的属性 例如在 BorderStyle 中有以下的四个选择: 0 - None 1 - Dashed 2 - Single Line 3 - Double Line 4 - 3D 首先在控件中定义以下的集合: Enum BorderType None Dashed [Single Line] [Double Line] [3D] End Enum 然后就可以把属性的类型设置好: Public Property Get BorderStyle() As BorderType Border = m_BorderStyle End Property
Public Property Let BorderStyle(ByVal New_BorderStyle As BorderType) m_Bor [1] [2] [3] 下一页
|