www.pudn.com > VBproject VCD.rar > UserCtrlActionButton.ctl, change:2003-05-22,size:3145b


VERSION 5.00 
Begin VB.UserControl UserCtrlActionButton  
   ClientHeight    =   3600 
   ClientLeft      =   0 
   ClientTop       =   0 
   ClientWidth     =   4800 
   ScaleHeight     =   3600 
   ScaleWidth      =   4800 
   Begin VB.CommandButton cmdActor  
      Height          =   2895 
      Left            =   1320 
      Picture         =   "UserCtrlActionButton.ctx":0000 
      Style           =   1  'Graphical 
      TabIndex        =   0 
      Top             =   360 
      Width           =   2895 
   End 
   Begin VB.Timer TimerCtrl  
      Interval        =   100 
      Left            =   360 
      Top             =   2880 
   End 
End 
Attribute VB_Name = "UserCtrlActionButton" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = True 
Attribute VB_PredeclaredId = False 
Attribute VB_Exposed = True 
Event evtclick() 
'缺省属性值: 
Const m_def_OverPic = "H:\pictures\美少女\pic_1047712371.jpg" 
Const m_def_DownPic = "H:\pictures\美少女\mm003.jpg" 
Const m_def_RegPic = "H:\pictures\美少女\0002.gif" 
'属性变量: 
Dim m_OverPic As Variant 
Dim m_DownPic As String 
Dim m_RegPic As Variant 
 
Private Sub cmdActor_Click() 
RaiseEvent evtclick 
End Sub 
 
Private Sub TimerCtrl_Timer() 
Dim lonCStat As Long 
Dim lonCurrhWnd As Long 
Dim mpoiCursorpos As pointapi 
lonCStat = GetCursorPos&(mpoiCursorpos) 
lonCurrhWhd = WindowFromPoint(mpoiCursorpos.x, mpoiCursorpos.y) 
If lonCurrhwd = cmdActor.hWnd Then 
   cmdActor.Picture = LoadPicture(m_OverPic) 
Else 
   cmdActor.Picture = LoadPicture(m_RegPic) 
End If 
End Sub 
'注意!不要删除或修改下列被注释的行! 
'MemberInfo=14,0,0,0 
Public Property Get OverPic() As Variant 
    OverPic = m_OverPic 
End Property 
 
Public Property Let OverPic(ByVal New_OverPic As Variant) 
    m_OverPic = New_OverPic 
    PropertyChanged "OverPic" 
End Property 
 
'注意!不要删除或修改下列被注释的行! 
'MemberInfo=13,0,0, 
Public Property Get DownPic() As String 
    DownPic = m_DownPic 
End Property 
 
Public Property Let DownPic(ByVal New_DownPic As String) 
    m_DownPic = New_DownPic 
    PropertyChanged "DownPic" 
End Property 
 
'注意!不要删除或修改下列被注释的行! 
'MemberInfo=14,0,0,0 
Public Property Get RegPic() As Variant 
    RegPic = m_RegPic 
End Property 
 
Public Property Let RegPic(ByVal New_RegPic As Variant) 
    m_RegPic = New_RegPic 
    PropertyChanged "RegPic" 
End Property 
 
'为用户控件初始化属性 
Private Sub UserControl_InitProperties() 
    m_OverPic = m_def_OverPic 
    m_DownPic = m_def_DownPic 
    m_RegPic = m_def_RegPic 
End Sub 
 
'从存贮器中加载属性值 
Private Sub UserControl_ReadProperties(PropBag As PropertyBag) 
 
    m_OverPic = PropBag.ReadProperty("OverPic", m_def_OverPic) 
    m_DownPic = PropBag.ReadProperty("DownPic", m_def_DownPic) 
    m_RegPic = PropBag.ReadProperty("RegPic", m_def_RegPic) 
End Sub 
 
'将属性值写到存储器 
Private Sub UserControl_WriteProperties(PropBag As PropertyBag) 
 
    Call PropBag.WriteProperty("OverPic", m_OverPic, m_def_OverPic) 
    Call PropBag.WriteProperty("DownPic", m_DownPic, m_def_DownPic) 
    Call PropBag.WriteProperty("RegPic", m_RegPic, m_def_RegPic) 
End Sub