?? ucverywellsstatusbarxp.ctl
字號:
VERSION 5.00
Begin VB.UserControl ucVeryWellsStatusBarXP
Alignable = -1 'True
AutoRedraw = -1 'True
ClientHeight = 420
ClientLeft = 0
ClientTop = 0
ClientWidth = 5940
ControlContainer= -1 'True
PropertyPages = "ucVeryWellsStatusBarXP.ctx":0000
ScaleHeight = 28
ScaleMode = 3 'Pixel
ScaleWidth = 396
ToolboxBitmap = "ucVeryWellsStatusBarXP.ctx":003F
End
Attribute VB_Name = "ucVeryWellsStatusBarXP"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'
' ucVeryWellsStatusBarXP.ctl V. 1.1
'
' Origin: xpWellsStatusBar by Richard Wells
' Redesign and extensions: Light Templer (Reach me on GMX : schwepps_bitterlemon@gmx.de)
'
' Addition on 26.5.2003 MICK-S makes an update to XPwellsStatusBar. He added the Office XP apperance and the
' UseWindowsColors property. I put it into VeryWellsStatusBarXP to have a All-In-One solution.
' Examples updated to show most of the feautures.
'
' Special thanx to: Keith 'LaVolpe' Fox for the API timer code.
' Steve 'vbAaccelerator' McMahon for details on icons and lots of stuff.
' Carlos 'mztools' Quintero for his great freeware VB addin.
'
' Last changes by LT 1.6.2003
'
' Historie: 1.6.2003 * MEZ Fixed a bug in UserControl_Click()/UserControl_DblClick() handling
' events on disabled panels. Thx to 'Dream' !
' 2.6.2003 * Some improvements to draw_gradient().
' * Added "Public Sub ClearPanel(lPanelIndex As Long)" to erase the text
' on a panel without a total redraw. Used it immediatly for PanelCaption.
' This shortens the time for the API timer event very much!
' 3.6.2003 * Three new panel types (to be 'complete' ;)) : NUMLOCK, SCROLL, CAPSLOCK
' (Does anybody really use this ?)
' * Tags for panels included.
'
' 3.6.2003 * Changed the Read/Write property strategy. This speeds things up and should solve
' the problems some people have.
' * Two brand new styles (Appearance): XP Diagonal Left + Right ! A tribute to
' the 'LaVolpe-Button' Keith Fox wrote. Now you can use the diagonal styled buttons
' on a diagonal styled statusbar!
' * Changed revision to 1.1
Option Explicit
' *******************************
' * EVENTS *
' *******************************
Public Event MouseDownInPanel(iPanel As Long)
Public Event Click(iPanelNumber)
Public Event DblClick(iPanelNumber)
Public Event TimerBeforeRedraw()
Public Event TimerAfterRedraw()
Public Event BeforeRedraw()
Public Event AfterRedraw()
' *************************************
' * PUBLIC ENUMS *
' *************************************
Public Enum enVWsbXPApperance ' "Apperance" is a too common name for a public var, so I added some unique stuff.
[Office XP] = 0
[Windows XP] = 1
[Simple] = 2
[XP Diagonal Left] = 3
[XP Diagonal Right] = 4
End Enum
' *************************************
' * PRIVATE CONSTS (DEFAULTS) *
' *************************************
Private Const m_def_UseWindowsColors = False
Private Const m_def_Apperance = [Windows XP]
' *************************************
' * PRIVATE TYPE *
' *************************************
Private Type BITMAPINFOHEADER '40 bytes
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type
Private Type RGBQUAD
rgbBlue As Byte
rgbGreen As Byte
rgbRed As Byte
rgbReserved As Byte
End Type
Private Type BITMAPINFO
bmiHeader As BITMAPINFOHEADER
bmiColors(1) As RGBQUAD
End Type
' *************************************
' * API DEFINITIONS *
' *************************************
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function CreateRectRgnIndirect Lib "gdi32" _
(lpRect As RECT) As Long
Private Declare Function PtInRegion Lib "gdi32" _
(ByVal hRgn As Long, _
ByVal X As Long, _
ByVal Y As Long) As Long
Private Declare Function OffsetRect Lib "user32" _
(lpRect As RECT, _
ByVal X As Long, _
ByVal Y As Long) As Long
Private Declare Function CopyRect Lib "user32" _
(lpDestRect As RECT, _
lpSourceRect As RECT) 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 SetProp Lib "user32" Alias "SetPropA" _
(ByVal hwnd As Long, _
ByVal lpString As String, _
ByVal hData As Long) As Long
Private Declare Function SetTimer Lib "user32" _
(ByVal hwnd As Long, _
ByVal nIDEvent As Long, _
ByVal uElapse As Long, _
ByVal lpTimerFunc As Long) As Long
Private Declare Function KillTimer Lib "user32" _
(ByVal hwnd As Long, _
ByVal nIDEvent As Long) As Long
Private Declare Function DrawEdge Lib "user32" _
(ByVal hDC As Long, _
qrc As RECT, _
ByVal edge As Long, _
ByVal grfFlags As Long) As Long
Private Declare Function InflateRect Lib "user32" _
(lpRect As RECT, _
ByVal X As Long, _
ByVal Y As Long) As Long
Private Declare Function GetSysColor Lib "user32" _
(ByVal nIndex 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
Private Declare Function SetBkColor Lib "gdi32" _
(ByVal hDC As Long, _
ByVal crColor As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" _
(ByVal hDC 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 SelectObject Lib "gdi32" _
(ByVal hDC As Long, _
ByVal hObject As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" _
(ByVal hObject As Long) As Long
Private Declare Function GetDC Lib "user32" _
(ByVal hwnd 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 GetBkColor Lib "gdi32" _
(ByVal hDC As Long) As Long
Private Declare Function GetTextColor Lib "gdi32" _
(ByVal hDC 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 ReleaseDC Lib "user32" _
(ByVal hwnd As Long, _
ByVal hDC As Long) As Long
Private Declare Function CreateHalftonePalette Lib "gdi32" _
(ByVal hDC As Long) As Long
Private Declare Function CreateDIBSection Lib "gdi32" _
(ByVal hDC As Long, _
pBitmapInfo As BITMAPINFO, _
ByVal un As Long, _
ByVal lplpVoid As Long, _
ByVal handle As Long, _
ByVal dw As Long) As Long
Private Declare Function SetDIBColorTable Lib "gdi32" _
(ByVal hDC As Long, _
ByVal un1 As Long, _
ByVal un2 As Long, _
pcRGBQuad As RGBQUAD) As Long
Private Declare Function SetMapMode Lib "gdi32" _
(ByVal hDC As Long, _
ByVal nMapMode As Long) As Long
Private Declare Function GetMapMode Lib "gdi32" _
(ByVal hDC As Long) As Long
Private Declare Function GetClientRect Lib "user32" _
(ByVal hwnd As Long, _
lpRect As RECT) As Long
Private Declare Function SetTextColor Lib "gdi32" _
(ByVal hDC As Long, _
ByVal crColor As Long) As Long
Private Declare Function DrawText Lib "user32" Alias "DrawTextA" _
(ByVal hDC As Long, _
ByVal lpStr As String, _
ByVal nCount As Long, _
lpRect As RECT, _
ByVal wFormat As Long) As Long
Private Declare Function SetPixel Lib "gdi32" Alias "SetPixelV" _
(ByVal hDC As Long, _
ByVal X As Long, _
ByVal Y As Long, _
ByVal crColor As Long) As Long
Private Declare Function GetKeyboardState Lib "user32" _
(kbArray As KeyboardBytes) As Long
' *************************************
' * API CONSTANTS *
' *************************************
' For DrawText
Private Const DT_CALCRECT = &H400
Private Const DT_WORDBREAK = &H10
Private Const DT_LEFT = &H0
Private Const DT_CENTER = &H1
Private Const DT_RIGHT = &H2
Private Const DT_WORD_ELLIPSIS = &H40000
' Win32 edge draw consts
Private Const BF_BOTTOM = &H8
Private Const BF_RIGHT = &H4
Private Const BF_BOTTOMRIGHT = (BF_BOTTOM Or BF_RIGHT)
Private Const BF_TOP = &H2
Private Const BF_LEFT = &H1
Private Const BF_TOPLEFT = (BF_TOP Or BF_LEFT)
' Win32 Special color values
Private Const CLR_INVALID = -1
Private Const COLOR_HIGHLIGHT = 13
Private Const COLOR_BTNFACE = 15
Private Const COLOR_BTNSHADOW = 16
Private Const COLOR_BTNTEXT = 18
Private Const COLOR_BTNHIGHLIGHT = 20
Private Const COLOR_BTNDKSHADOW = 21
Private Const COLOR_BTNLIGHT = 22
' DIB Section constants
Private Const BI_RGB = 0&
Private Const DIB_RGB_COLORS = 0 ' color table in RGBs
' Raster Operation Codes
Private Const DSna = &H220326 '0x00220326
Private Const ScrCopy = &HCC0020
' VB Errors
Private Const giINVALID_PICTURE As Integer = 481
' Misc
Private Const VK_CAPITAL = &H14
Private Const VK_NUMLOCK = &H90
Private Const VK_SCROLL = &H91
Private Const vbGray = 8421504
' *************************************
' * PRIVATES *
' *************************************
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -