I am trying to learn how to make an ActiveX control. I followed a tutorial but all it does is make a messagebox come up with its titlebar having the name of the control. What is it supposed to teach me? I am pasting the code unless its wrong.Thanks
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(KeyAsci)
End Sub
Private Sub MyControl_ReadProperties(PropertyBag)
TextVariable = PropBag.ReadProperty("Text", "There is no message")
End Sub
Private Sub MyControl_Resize()
Command1.Width = MyControl.Width
Command1.Height = MyControl.Height
End Sub
Public Property Get Text() As String
Text = TextVariable
End Property
Private Sub MyControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Text", TextVariable, "There is no message")
End Sub
Public Property Let Text(ByVal New_Text As String)
TextVariable = New_Text
PropertyChanged = "Text"
End Property
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(KeyAsci)
End Sub
Private Sub MyControl_ReadProperties(PropertyBag)
TextVariable = PropBag.ReadProperty("Text", "There is no message")
End Sub
Private Sub MyControl_Resize()
Command1.Width = MyControl.Width
Command1.Height = MyControl.Height
End Sub
Public Property Get Text() As String
Text = TextVariable
End Property
Private Sub MyControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Text", TextVariable, "There is no message")
End Sub
Public Property Let Text(ByVal New_Text As String)
TextVariable = New_Text
PropertyChanged = "Text"
End Property