custom button caption issue
I have created a custom button control with a caption property. When I am using this in another project, I am able to set the caption to whatever I want, and it shows correctly in design mode, however when I am running the project the button caption still shows as the default I have set on the control, how do I fix this?
Here is my code on the control:
VB Code:
Public Event Click()
Private lblCaption As String
Private Sub imgUp_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
imgUp.Visible = False
imgDown.Visible = True
End Sub
Private Sub imgUp_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
imgUp.Visible = True
imgDown.Visible = False
RaiseEvent Click
End Sub
Private Sub Label1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
imgUp.Visible = False
imgDown.Visible = True
End Sub
Private Sub Label1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
imgUp.Visible = True
imgDown.Visible = False
RaiseEvent Click
End Sub
Property Get Caption() As String
lblCaption = UserControl.Label1.Caption
End Property
Property Let Caption(capt As String)
UserControl.Label1.Caption = capt
PropertyChanged "Caption"
End Property