請問各位大大:<br>小弟自行建立一ActiveX控制項,其有自行定義的屬性值,假設小弟想預設此屬性質之預設值為0<br>要如何設定呢?<br>謝謝大大.......
'定義一個const: Const m_def_V = 0 '在寫入屬性中: Private Sub UserControl_WriteProperties(PropBag As PropertyBag) Call PropBag.WriteProperty("屬性名稱", m_test, m_def_V) '------------- Public Property Get 屬性名稱() As Integer 屬性名稱 = m_test End Property '------------- Public Property Let 屬性名稱(ByVal New_test As Integer) m_test = New_test PropertyChanged "屬性名稱" End Property '初始化屬性中: Private Sub UserControl_InitProperties() m_test = m_def_V '這樣"屬性名稱"的預設值就是0了