Make your own free website on Tripod.com
Make Your First ActiveX Control

Lesson 1
Tutorials - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14

By now, your code should look like this:

Dim TextVariable As String

Event
Click()
Event KeyPress(KeyAscii As Integer)

Private Sub Command1_Click()
    MsgBox (TextVariable)
    RaiseEvent Click
End Sub

Private Sub Command1_KeyPress(KeyAscii As Integer)
    RaiseEvent KeyPress(KeyAscii)
End Sub

Private Sub UserControl_Resize()
    Command1.Width = UserControl.Width
    Command1.Height = UserControl.Height
End Sub

Public Property Get Text() As String
   
Text = TextVariable
End Property

Public Property Let Text(ByVal New_Text As String)
    TextVariable = New_Text
    PropertyChanged "Text"
End Property


Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
    TextVariable = PropBag.ReadProperty("Text", "There is no message")
End Sub

Private Sub
UserControl_WriteProperties(PropBag As PropertyBag)
    Call PropBag.WriteProperty("Text", TextVariable, "There is no message) 
End Sub

Back  Forward