Type Class_Button Extends Class_Control
    Declare Property Caption() As CWStr                '返回/设置控件中的文本
    Declare Property Caption(ByVal sText As CWStr)
    Declare Sub Click() '模拟用户点击了这个按钮
End Type
     
'----------------------------------------------------------------------------------------------------------------------------------------------------------------

Property Class_Button.Caption() As CWStr
  Return AfxGetWindowText(hWndControl)
End Property
Property Class_Button.Caption(ByVal sText As CWStr)
  AfxSetWindowText  hWndControl, sText
End Property
Sub Class_Button.Click() '模拟用户点击了这个按钮
  SendMessage(hWndControl, BM_CLICK, 0, 0)
End Sub
