AeroGroupBox.ctl
上传用户:jnjasmy
上传日期:2015-01-04
资源大小:637k
文件大小:8k
- VERSION 5.00
- Begin VB.UserControl AeroGroupBox
- BackColor = &H00C0C0C0&
- ClientHeight = 3600
- ClientLeft = 0
- ClientTop = 0
- ClientWidth = 4800
- ClipControls = 0 'False
- ControlContainer= -1 'True
- BeginProperty Font
- Name = "Segoe UI"
- Size = 9
- Charset = 0
- Weight = 400
- Underline = 0 'False
- Italic = 0 'False
- Strikethrough = 0 'False
- EndProperty
- MaskColor = &H00C0C0C0&
- ScaleHeight = 240
- ScaleMode = 3 'Pixel
- ScaleWidth = 320
- ToolboxBitmap = "AeroGroupBox.ctx":0000
- End
- Attribute VB_Name = "AeroGroupBox"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = True
- Attribute VB_PredeclaredId = False
- Attribute VB_Exposed = True
- Option Explicit
- Private Declare Function RoundRect Lib "gdi32.dll" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long, ByVal X3 As Long, ByVal Y3 As Long) As Long
- Private m_CRect As RECT
- 'Default Property Values:
- Const m_def_Caption = ""
- Const m_def_ForeColor = vbBlack
- 'Property Variables:
- Dim m_Caption As String
- Dim m_ForeColor As OLE_COLOR
- Dim m_BackColor As OLE_COLOR
- 'Event Declarations:
- Event Click() 'MappingInfo=UserControl,UserControl,-1,Click
- Attribute Click.VB_Description = "Occurs when the user presses and then releases a mouse button over an object."
- Attribute Click.VB_UserMemId = -600
- Event DblClick() 'MappingInfo=UserControl,UserControl,-1,DblClick
- Attribute DblClick.VB_Description = "Occurs when the user presses and releases a mouse button and then presses and releases it again over an object."
- Attribute DblClick.VB_UserMemId = -601
- Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=UserControl,UserControl,-1,MouseDown
- Attribute MouseDown.VB_Description = "Occurs when the user presses the mouse button while an object has the focus."
- Attribute MouseDown.VB_UserMemId = -605
- Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=UserControl,UserControl,-1,MouseMove
- Attribute MouseMove.VB_Description = "Occurs when the user moves the mouse."
- Attribute MouseMove.VB_UserMemId = -606
- Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=UserControl,UserControl,-1,MouseUp
- Attribute MouseUp.VB_Description = "Occurs when the user releases the mouse button while an object has the focus."
- Attribute MouseUp.VB_UserMemId = -607
- Public Sub About()
- Attribute About.VB_UserMemId = -552
- fAbout.Show vbModal
- End Sub
- Private Sub UserControl_AmbientChanged(PropertyName As String)
- UserControl_Resize
- End Sub
- Private Sub UserControl_Paint()
- Call UserControl_Resize
- End Sub
- Private Sub UserControl_Resize()
- On Error Resume Next
- With UserControl
- .Cls
- .ForeColor = vbWhite
- RoundRect UserControl.hdc, 1, (TextHeight("H") / 2) + 1, ScaleWidth - 2, ScaleHeight - 1, 5, 5
- .ForeColor = RGB(213, 223, 229)
- RoundRect UserControl.hdc, 0, (TextHeight("H") / 2), ScaleWidth - 1, ScaleHeight - 2, 5, 5
- .ForeColor = m_ForeColor
- If m_Caption <> "" Then
- SetRect m_CRect, 6, 0, .TextWidth(m_Caption) + 12, .TextHeight(m_Caption)
- UserControl.Line (6, 0)-(.TextWidth(m_Caption) + 12, .TextHeight(m_Caption)), m_BackColor, BF
- DrawText UserControl.hdc, m_Caption, -1, m_CRect, DT_CENTER Or DT_VCENTER
- End If
- Set UserControl.MaskPicture = UserControl.Image
- End With
- End Sub
- Public Property Get BackColor() As OLE_COLOR
- Attribute BackColor.VB_ProcData.VB_Invoke_Property = ";Appearance"
- Attribute BackColor.VB_UserMemId = -501
- BackColor = m_BackColor
- End Property
- Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
- m_BackColor = New_BackColor
- PropertyChanged "BackColor"
- UserControl.BackColor = m_BackColor
- UserControl_Resize
- End Property
- 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
- 'MappingInfo=UserControl,UserControl,-1,ForeColor
- Public Property Get ForeColor() As OLE_COLOR
- Attribute ForeColor.VB_Description = "Returns/sets the foreground color used to display text and graphics in an object."
- Attribute ForeColor.VB_ProcData.VB_Invoke_Property = ";Appearance"
- Attribute ForeColor.VB_UserMemId = -513
- ForeColor = m_ForeColor
- End Property
- Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
- m_ForeColor = New_ForeColor
- PropertyChanged "ForeColor"
- UserControl_Resize
- End Property
- 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
- 'MappingInfo=UserControl,UserControl,-1,Enabled
- Public Property Get Enabled() As Boolean
- Attribute Enabled.VB_Description = "Returns/sets a value that determines whether an object can respond to user-generated events."
- Attribute Enabled.VB_ProcData.VB_Invoke_Property = ";Behavior"
- Attribute Enabled.VB_UserMemId = -514
- Enabled = UserControl.Enabled
- End Property
- Public Property Let Enabled(ByVal New_Enabled As Boolean)
- UserControl.Enabled() = New_Enabled
- PropertyChanged "Enabled"
- End Property
- 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
- 'MappingInfo=UserControl,UserControl,-1,Font
- Public Property Get Font() As Font
- Attribute Font.VB_Description = "Returns a Font object."
- Attribute Font.VB_ProcData.VB_Invoke_Property = ";Font"
- Attribute Font.VB_UserMemId = -512
- Set Font = UserControl.Font
- End Property
- Public Property Set Font(ByVal New_Font As Font)
- Set UserControl.Font = New_Font
- PropertyChanged "Font"
- End Property
- 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
- 'MappingInfo=UserControl,UserControl,-1,Refresh
- Public Sub Refresh()
- Attribute Refresh.VB_Description = "Forces a complete repaint of a object."
- Attribute Refresh.VB_UserMemId = -550
- UserControl.Refresh
- End Sub
- Private Sub UserControl_Click()
- RaiseEvent Click
- End Sub
- Private Sub UserControl_DblClick()
- RaiseEvent DblClick
- 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)
- RaiseEvent MouseMove(Button, Shift, X, Y)
- 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
- 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
- 'MappingInfo=UserControl,UserControl,-1,hWnd
- Public Property Get hWnd() As Long
- Attribute hWnd.VB_Description = "Returns a handle (from Microsoft Windows) to an object's window."
- Attribute hWnd.VB_ProcData.VB_Invoke_Property = ";Misc"
- Attribute hWnd.VB_UserMemId = -515
- hWnd = UserControl.hWnd
- End Property
- 'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
- 'MemberInfo=13,0,0,
- Public Property Get Caption() As String
- Attribute Caption.VB_ProcData.VB_Invoke_Property = ";Appearance"
- Attribute Caption.VB_UserMemId = -518
- Caption = m_Caption
- End Property
- Public Property Let Caption(ByVal New_Caption As String)
- m_Caption = New_Caption
- PropertyChanged "Caption"
- UserControl_Resize
- End Property
- 'Initialize Properties for User Control
- Private Sub UserControl_InitProperties()
- Set UserControl.Font = Ambient.Font
- m_Caption = Ambient.DisplayName
- m_ForeColor = m_def_ForeColor
- m_BackColor = Ambient.BackColor
- End Sub
- 'Load property values from storage
- Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
- m_BackColor = PropBag.ReadProperty("BackColor")
- m_ForeColor = PropBag.ReadProperty("ForeColor", m_def_ForeColor)
- UserControl.Enabled = PropBag.ReadProperty("Enabled", True)
- Set UserControl.Font = PropBag.ReadProperty("Font", Ambient.Font)
- m_Caption = PropBag.ReadProperty("Caption", m_def_Caption)
- UserControl.BackColor = m_BackColor
- End Sub
- Private Sub UserControl_Show()
- UserControl_Resize
- End Sub
- 'Write property values to storage
- Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
- Call PropBag.WriteProperty("BackColor", m_BackColor)
- Call PropBag.WriteProperty("ForeColor", m_ForeColor, m_def_ForeColor)
- Call PropBag.WriteProperty("Enabled", UserControl.Enabled, True)
- Call PropBag.WriteProperty("Font", UserControl.Font, Ambient.Font)
- Call PropBag.WriteProperty("Caption", m_Caption, m_def_Caption)
- End Sub