www.pudn.com > QQ2009.rar > cHyperLink.ctl, change:2009-11-15,size:4634b


VERSION 5.00 
Begin VB.UserControl cHyperLink  
   AutoRedraw      =   -1  'True 
   BackColor       =   &H00FFF4E4& 
   ClientHeight    =   3600 
   ClientLeft      =   0 
   ClientTop       =   0 
   ClientWidth     =   4800 
   BeginProperty Font  
      Name            =   "Verdana" 
      Size            =   9 
      Charset         =   0 
      Weight          =   400 
      Underline       =   0   'False 
      Italic          =   0   'False 
      Strikethrough   =   0   'False 
   EndProperty 
   ForeColor       =   &H00EB7016& 
   ScaleHeight     =   240 
   ScaleMode       =   3  'Pixel 
   ScaleWidth      =   320 
   ToolboxBitmap   =   "cHyperLink.ctx":0000 
End 
Attribute VB_Name = "cHyperLink" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = True 
Attribute VB_PredeclaredId = False 
Attribute VB_Exposed = False 
 
Option Explicit 
 
Const m_def_Caption = "" 
 
Dim m_Caption As String 
Dim MouseOver As Boolean 
 
Event Click() 
Event DblClick() 
Event KeyDown(KeyCode As Integer, Shift As Integer) 
Event KeyPress(KeyAscii As Integer) 
Event KeyUp(KeyCode As Integer, Shift As Integer) 
Event MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) 
Event MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) 
Event MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) 
Event MouseOut() 
 
Private Sub Redraw() 
    UserControl.Cls 
     
    CurrentX = 0 
    CurrentY = 0 
    Font.Underline = MouseOver 
     
    Print m_Caption 
End Sub 
 
Public Property Get BackColor() As OLE_COLOR 
Attribute BackColor.VB_Description = "返回/设置对象中文本和图形的背景色。" 
    BackColor = UserControl.BackColor 
End Property 
 
Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR) 
    UserControl.BackColor() = New_BackColor 
    PropertyChanged "BackColor" 
End Property 
 
Public Property Get ForeColor() As OLE_COLOR 
Attribute ForeColor.VB_Description = "返回/设置对象中文本和图形的前景色。" 
    ForeColor = UserControl.ForeColor 
End Property 
 
Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR) 
    UserControl.ForeColor() = New_ForeColor 
    Redraw 
     
    PropertyChanged "ForeColor" 
End Property 
 
Private Sub UserControl_Click() 
    RaiseEvent Click 
End Sub 
 
Private Sub UserControl_DblClick() 
    RaiseEvent DblClick 
End Sub 
 
Private Sub UserControl_KeyDown(KeyCode As Integer, Shift As Integer) 
    RaiseEvent KeyDown(KeyCode, Shift) 
End Sub 
 
Private Sub UserControl_KeyPress(KeyAscii As Integer) 
    RaiseEvent KeyPress(KeyAscii) 
End Sub 
 
Private Sub UserControl_KeyUp(KeyCode As Integer, Shift As Integer) 
    RaiseEvent KeyUp(KeyCode, Shift) 
End Sub 
 
Private Sub UserControl_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) 
    RaiseEvent MouseDown(Button, Shift, x, y) 
End Sub 
 
Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) 
    Dim oldFlag As Boolean 
    oldFlag = MouseOver 
     
    If x < 0 Or y < 0 Or x > UserControl.ScaleWidth Or y > UserControl.ScaleHeight Then 
        MouseOver = False 
        RaiseEvent MouseOut 
         
        ReleaseCapture 
    Else 
        SetHand 
        MouseOver = True 
        RaiseEvent MouseMove(Button, Shift, x, y) 
         
        SetCapture UserControl.hWnd 
    End If 
     
    If oldFlag <> MouseOver Then Redraw 
End Sub 
 
Private Sub UserControl_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) 
    RaiseEvent MouseUp(Button, Shift, x, y) 
End Sub 
 
Public Property Get Caption() As String 
    Caption = m_Caption 
End Property 
 
Public Property Let Caption(ByVal New_Caption As String) 
    m_Caption = New_Caption 
    Redraw 
     
    PropertyChanged "Caption" 
End Property 
 
Private Sub UserControl_InitProperties() 
    m_Caption = m_def_Caption 
End Sub 
 
Private Sub UserControl_ReadProperties(PropBag As PropertyBag) 
    UserControl.BackColor = PropBag.ReadProperty("BackColor", &HFFF4E4) 
    UserControl.ForeColor = PropBag.ReadProperty("ForeColor", &HEB7016) 
    m_Caption = PropBag.ReadProperty("Caption", m_def_Caption) 
     
    Redraw 
End Sub 
 
Private Sub UserControl_Resize() 
    UserControl.Height = TextHeight(m_Caption) * Screen.TwipsPerPixelY 
 
    Redraw 
End Sub 
 
Private Sub UserControl_WriteProperties(PropBag As PropertyBag) 
    Call PropBag.WriteProperty("BackColor", UserControl.BackColor, &H8000000F) 
    Call PropBag.WriteProperty("ForeColor", UserControl.ForeColor, &H80000012) 
    Call PropBag.WriteProperty("Caption", m_Caption, m_def_Caption) 
End Sub