?? xpframe.ctl
字號:
VERSION 5.00
Begin VB.UserControl xpFrame
Alignable = -1 'True
ClientHeight = 780
ClientLeft = 0
ClientTop = 0
ClientWidth = 2505
ControlContainer= -1 'True
DrawWidth = 56
EditAtDesignTime= -1 'True
ScaleHeight = 52
ScaleMode = 3 'Pixel
ScaleWidth = 167
ToolboxBitmap = "xpFrame.ctx":0000
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "Frame1"
Height = 195
Left = 135
TabIndex = 0
Top = -30
Visible = 0 'False
Width = 525
End
End
Attribute VB_Name = "xpFrame"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'===Declarations enumations et types======================================================================================================
Private Declare Function GetWindowDC Lib "user32.dll" (ByVal hWnd As Long) As Long
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Declare Function TransparentBlt Lib "msimg32.dll" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal crTransparent As Long) As Boolean
Private Declare Function MoveWindow Lib "User32" (ByVal hWnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
'Private Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function ClientToScreen Lib "User32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long
Private Declare Function InflateRect Lib "User32" (lpRect As RECT, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Sub SetWindowPos Lib "User32" (ByVal hWnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cX As Long, ByVal cY As Long, ByVal wFlags As Long)
Private Declare Function PostMessage Lib "User32" Alias "PostMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Declare Function GetClientRect Lib "User32" (ByVal hWnd As Long, lpRect As RECT) As Long
Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode As Long) As Long
Private Declare Function GetWindowLong Lib "User32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "User32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function LockWindowUpdate Lib "User32" (ByVal hwndLock As Long) As Long
Private Declare Function GetIconInfo Lib "User32" (ByVal hIcon As Long, piconinfo As ICONINFO) As Long
Private Declare Function CopyImage Lib "User32" (ByVal Handle As Long, ByVal imageType As Long, ByVal newWidth As Long, ByVal newHeight As Long, ByVal lFlags As Long) As Long
Private Declare Function GetDC Lib "User32" (ByVal hWnd As Long) As Long
Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetMapMode Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function SetMapMode Lib "gdi32" (ByVal hdc As Long, ByVal nMapMode As Long) As Long
Private Declare Function SelectPalette Lib "gdi32" (ByVal hdc As Long, ByVal HPALETTE As Long, ByVal bForceBackground As Long) As Long
Private Declare Function RealizePalette Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
Private Declare Function GetBkColor Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
Private Declare Function ReleaseDC Lib "User32" (ByVal hWnd As Long, ByVal hdc As Long) As Long
Private Declare Function GetTextColor Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function SetTextColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
Private Declare Function GetSysColor Lib "User32" (ByVal nIndex As Long) As Long
Private Declare Function CreateBitmap Lib "gdi32" (ByVal nWidth As Long, ByVal nHeight As Long, ByVal nPlanes As Long, ByVal nBitCount As Long, lpBits As Any) As Long
Private Declare Function DrawIconEx Lib "User32" (ByVal hdc As Long, ByVal xLeft As Long, ByVal yTop As Long, ByVal hIcon As Long, ByVal cxWidth As Long, ByVal cyWidth As Long, ByVal istepIfAniCur As Long, ByVal hbrFlickerFreeDraw As Long, ByVal diFlags As Long) As Long
Private Declare Function GetObjectAPI Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObj As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObj As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal XSrc As Long, ByVal YSrc As Long, ByVal dwRop As Long) As Long
Const SRCAND = &H8800C6
Const SRCCOPY = &HCC0020
Const SRCERASE = &H440328
Const SRCINVERT = &H660046
Const SRCPAINT = &HEE0086
Private Type BITMAP
bmType As Long
bmWidth As Long
bmHeight As Long
bmWidthBytes As Long
bmPlanes As Integer
bmBitsPixel As Integer
bmBits As Long
End Type
Private Type ICONINFO
fIcon As Long
xHotSpot As Long
yHotSpot As Long
hbmMask As Long
hbmColor As Long
End Type
Public Enum Theme
xThemeDarkBlue
xThemeMoney
xThemeMediaPlayer
xThemeMediaPlayer2
xThemeGreen
xThemeMetallic
xThemeOffice2003
xThemeOrange
xThemeTurquoise
xThemeGray
xThemeDarkBlue2
xThemeLightBlue
End Enum
'Public Enum PictureAlign
' xAlignLeftEdge '-->Left edge
' xAlignRightEdge '-->Right Edge
' xAlignLeftOfCaption '-->Left of the caption
' xAlignRightOfCaption '-->Right of the caption
'End Enum
Public Enum TextAlign
xAlignLefttop
xAlignLeftMiddle
xAlignLeftBottom
xAlignRightTop
xAlignRightMiddle
xAlignRightBottom
xAlignCenterTop
xAlignCenterMiddle
xAlignCenterBottom
End Enum
Public Enum FillStyle
HorizontalFading
VerticalFading
End Enum
Public Enum HeaderFooterStyleSize
Small
Medium
Large
End Enum
Public Enum FooterStyleSize
eMedium
eLarge
End Enum
Public Enum TraceBorderStyle
SOLID = 0 ' _______
DASH = 1 ' -------
DOT = 2 ' .......
DASHDOT = 3 ' _._._._
DASHDOTDOT = 4 ' _.._.._
NONE = 5
End Enum
Public Enum ShapeStyle
Squared
Rounded
End Enum
Public Enum HeaderBarStates
eBarcollapsed
eBarExpanded
End Enum
'resize
Private OldX As Single
Private OldY As Single
Private DragMode As Boolean
Dim MoveMe As Boolean
Dim SizeMe As Boolean
'===Constantes=========================================================================================================
'HELLO ME
'#Header
Private Const m_def_sHeaderText As String = "Header" 'texte du header
Private Const m_def_eHeaderTextAlign As Integer = xAlignLefttop 'alignement du caption
Private Const m_def_oHeaderTextColor As Long = vbWhite 'couleur texte header
Private Const m_def_eHeaderSize As Integer = HeaderFooterStyleSize.Medium 'taille
Private Const m_def_bHeaderVisible As Boolean = True 'visibilit?Private Const m_def_oHeaderBackColor As Long = &HFFFFFF 'couleur utilis閑 pour l'arri鑢e plan
Private Const m_def_oHeaderFadeColor As Long = &HD96C00 'couleur utilis閑 pour le gradient
Private Const m_def_eHeaderFillStyle As Integer = VerticalFading 'type du gradient
'#Footer
Private Const m_def_sFooterText As String = "Footer" 'texte du Footer
Private Const m_def_eFooterTextAlign As Integer = xAlignLefttop 'alignement du caption
Private Const m_def_oFooterTextColor As Long = vbWhite 'couleur texte Footer
Private Const m_def_eFooterSize As Integer = FooterStyleSize.eMedium 'taille
Private Const m_def_bFooterVisible As Boolean = True 'visibilit?Private Const m_def_oFooterBackColor As Long = &HD96C00 'couleur utilis閑 pour l'arri鑢e plan
Private Const m_def_oFooterFadeColor As Long = &HFFFFFF 'couleur utilis閑 pour le gradient
Private Const m_def_eFooterFillStyle As Integer = VerticalFading 'type du gradient
'#Container
Private Const m_def_oContainerBackColor As Long = vbButtonFace 'couleur utilis閑 pour l'arri鑢e plan
Private Const m_def_oContainerFadeColor As Long = vbButtonFace 'couleur utilis閑 pour le gradient
Private Const m_def_eContainerFillStyle As Integer = VerticalFading 'type du gradient
Private Const m_def_oContainerForeColor As Long = vbButtonText 'couleur utilis閑 pour le texte
Private Const m_def_oContainerBorderColor As Long = vbBlack 'couleur utilis閑 pour la bordure
Private Const m_def_eContainerBorderStyle As Integer = SOLID 'style de bordure
Private Const m_def_eContainerShapeStyle As Long = Squared 'forme du controle
Private Const m_def_iContainerCornerRadius As Integer = 20 'angle utilise pour les angles arrondis
'#divers
Private Const m_def_iTheme As Integer = xThemeDarkBlue 'theme par defaut
Private Const m_def_UseCustomColors As Boolean = False 'couleurs par defaut=faux
Private Const m_def_CollapseButtonColor As Long = vbRed
Private ValFooterTextAlign As Long
Private ValHeaderTextAlign As Long
Private bInitializing As Boolean 'pour eviter de redessiner sur initialize
'===Propri閠閟========================================================================================================
'#Header
Private m_sHeaderText As String 'texte du header
Private m_fHeaderTextFont As Font 'police du header
Private m_eHeaderTextAlign As Integer 'alignement du texte
Private m_oHeaderTextColor As OLE_COLOR 'couleur texte header
Private m_iHeaderSize As Integer 'taille
Private m_bHeaderVisible As Boolean 'visibilit?Private m_oHeaderBackColor As OLE_COLOR 'couleur utilis閑 pour l'arri鑢e plan
Private m_oHeaderFadeColor As OLE_COLOR 'couleur utilis閑 pour le gradient
Private m_eHeaderFillStyle As Integer 'type du gradient
Private m_HeaderPicture As StdPicture 'image du header
Private m_HeaderPictureSize As Long 'taille de l'image du header
'#Footer
Private m_sFooterText As String 'texte du Footer
Private m_fFooterTextFont As Font 'police du Footer
Private m_eFooterTextAlign As Integer 'alignement du texte
Private m_oFooterTextColor As OLE_COLOR 'couleur texte Footer
Private m_iFooterSize As Integer 'taille
Private m_bFooterVisible As Boolean 'visibilit?Private m_oFooterBackColor As OLE_COLOR 'couleur utilis閑 pour l'arri鑢e plan
Private m_oFooterFadeColor As OLE_COLOR 'couleur utilis閑 pour le gradient
Private m_eFooterFillStyle As Integer 'type du gradient
Private m_ebg As OLE_COLOR
'#Container
Private m_fContainerTextFont As Font 'police du container
Private m_oContainerBackColor As OLE_COLOR 'couleur utilis閑 pour l'arri鑢e plan
Private m_oContainerFadeColor As OLE_COLOR 'couleur utilis閑 pour le gradient
Private m_eContainerFillStyle As Integer 'type du gradient
Private m_oContainerForeColor As OLE_COLOR 'couleur utilis閑 pour le texte
Private m_oContainerBorderColor As OLE_COLOR 'couleur utilis閑 pour la bordure
Private m_eContainerBorderStyle As TraceBorderStyle 'style de bordure
Private m_eContainerShapeStyle As ShapeStyle 'forme du controle
Private m_iContainerCornerRadius As Integer 'angle utilise pour les angles arrondis
Private m_ContainerPicture As StdPicture 'image du container
Private m_ContainerPictureSize As Long 'taille de l'image du container
Private m_HeaderPictureVisible As Boolean
Private m_ContainerPictureVisible As Boolean
Private m_TopBuffer As Integer
Private m_LeftBuffer As Integer
Private m_Resize As Boolean
Private m_Moveable As Boolean
Private m_XPStyle As Boolean
Private m_zOrder As Boolean
Private m_cClose As Boolean
'#Divers
Private m_UseCustomColors As Boolean 'couleurs par defaut
Private m_enmTheme As Theme 'theme
Private m_bEnabled As Boolean 'enable
Private m_CanExpand As Boolean 'expandable
Private State As HeaderBarStates '閠at du controle
Private CollapseOffset As Long 'hauteur expandable/collapsable
Private m_CollapseButtonColor As OLE_COLOR 'couleur du bouton
'#Divers interm閐iares
'#Header
Private m_lColorHeaderColorOne As OLE_COLOR '1鑢e couleur du gradient
Private m_lColorHeaderColorTwo As OLE_COLOR '2鑝e couleur du gradient
Private m_lColorHeaderForeColor As OLE_COLOR 'recup鑢e la couleur du texte
Private m_hRegion As Long 'region du header
Private m_hRegionC As Long
Private m_hRegionB As Long 'region du header
Private m_lColorCollapseButtonColor As OLE_COLOR
'#Footer
Private m_lColorFooterColorOne As OLE_COLOR '1鑢e couleur du gradient
Private m_lColorFooterColorTwo As OLE_COLOR '2鑝e couleur du gradient
Private m_lColorFooterForeColor As OLE_COLOR 'recup鑢e la couleur du texte
'#Container
Private m_lColorContainerColorOne As OLE_COLOR '1鑢e couleur du gradient
Private m_lColorContainerColorTwo As OLE_COLOR '2鑝e couleur du gradient
Private m_lColorContainerColorBorder As OLE_COLOR 'recupere la couleur de la bordure
'=Evenements Public =======================================================================================================
Public Event Click()
Attribute Click.VB_UserMemId = -600
Public Event DblClick()
Attribute DblClick.VB_UserMemId = -601
Public Event KeyDown(KeyCode As Integer, Shift As Integer)
Attribute KeyDown.VB_UserMemId = -602
Public Event KeyPress(KeyAscii As Integer)
Attribute KeyPress.VB_UserMemId = -603
Public Event KeyUp(KeyCode As Integer, Shift As Integer)
Attribute KeyUp.VB_UserMemId = -604
Public Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Attribute MouseDown.VB_UserMemId = -605
Public Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single, cResize As Boolean, cMove As Boolean)
Public Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Attribute MouseUp.VB_UserMemId = -607
Public Event ChevronClick(Button As Integer, Shift As Integer, X As Single, Y As Single, Collapse As Boolean, FooterSize As Long, HeaderSize As Long, Height As Long)
Public Event Resize(cWidth As Long, cHeight As Long)
Public Event Move(cTop As Long, cLeft As Long)
'hDC (the hDC and hWnd code stripped from Mario Flores Cool Xp ProgressBar)
Private Declare Function CreateDC Lib "gdi32" Alias "CreateDCA" (ByVal lpDriverName As String, ByVallpDeviceName As String, ByVal lpOutput As String, lpInitData As Any) As Long
Private m_MemDC As Boolean
Private m_hDC As Long
Private m_ThDC As Long
Private m_hBmpOld As Long
Private m_hBmp As Long
Private m_lWidth As Long
Private m_lHeight As Long
Private m_hwnd As Long
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -