Unicode Controls & Classes for VB6 - Version 4

clsCommonWrapper.DrawButton Method

Draws a button on a specified Device Context

Syntax
Public Sub DrawButton (ByVal lHdc As Long, _
ByRef rWork As RECT, _
Optional ByVal lBackColor As Long = vbButtonFace, _
Optional ByVal bUseBorder As Boolean = True, _
Optional ByVal lBorderColor As Long = -1&, _
Optional ByVal bPressed As Boolean = False, _
Optional ByVal bDefault As Boolean = False, _
Optional ByVal bCancel As Boolean = False, _
Optional ByVal bDrawFocus As Boolean = False, _
Optional ByVal bRounded As Boolean = True, _
Optional ByVal iBtnStyle As eCtlButtonStyle = iCtlBtnStyle_UseDefault, _
Optional ByVal lBackColorOut As Long = -1&, _
Optional ByVal bCorrectLuminance As Boolean = True)
Parameters
Parameter Description
ByVal lHdc As Long Destination DC
ByRef rWork As RECT Rectangle coordinates
Optional ByVal lBackColor As Long = vbButtonFace Background color
Optional ByVal bUseBorder As Boolean = True Draw borders?
Optional ByVal lBorderColor As Long = -1& The color of the border, leave -1& for automatic management
Optional ByVal bPressed As Boolean = False Is the button pressed?
Optional ByVal bDefault As Boolean = False Is this a default dialog button? (Activated when the user presses ENTER)
Optional ByVal bCancel As Boolean = False Is this a cancel button? (Activated when the user presses the ESC key)
Optional ByVal bDrawFocus As Boolean = False Draw the focus rectangle?
Optional ByVal bRounded As Boolean = True Are borders rounded?
Optional ByVal iBtnStyle As eCtlButtonStyle = iCtlBtnStyle_UseDefault Style of the button
Optional ByVal lBackColorOut As Long = -1& Color of the external part of the border (when using Round borders)
Optional ByVal bCorrectLuminance As Boolean = True Permits to change colors when they are too light or too dark to be used in a good effect
Remarks
This function has been created in order to work for non transparent usercontrols
Check the [DrawButtonWL] method for drawing buttons using transparency (without filling parts that should be transparent on a standard control)