Author Topic: [SDK] 09 - Take control of your CHECKBOX BUTTON  (Read 7772 times)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1992
    • zapsolution
[SDK] 09 - Take control of your CHECKBOX BUTTON
« on: February 09, 2020, 05:10:12 pm »
WORK IN PROGRESS

You can now create a fourth type of button: CHECKBOX

zCheckButton ( _
BYVAL hOwner AS LONG, _ ' The Parent handle
zFullpathImageName AS ASCIIZ, _ ' Full path name to the image 2-state button
zLabel AS ASCIIZ, _ ' The button's label
BYVAL x AS LONG, _ ' The control X location
BYVAL y AS LONG, _ ' The control Y location
BYVAL xW AS LONG, _ ' The control width
BYVAL yH AS LONG,  _ ' The control height
BYVAL ButID AS LONG, _ ' The control unique identifier
BYVAL ARGBColor AS LONG _ ' The ARGB color to use with the text label
)

Note: there are a few minor changes to the source code to handle CheckBox and a few new functions:

'// Get check button status
Code: [Select]
FUNCTION zGetCheckButtonStatus(BYVAL hBut AS LONG) AS LONG
    IF SendMessage(hBut, %BM_GETCHECK, 0, 0) = %BST_CHECKED THEN
       FUNCTION = -1
    END IF
END FUNCTION

'// Set check button status
Code: [Select]
SUB zSetCheckButtonStatus(BYVAL hBut AS LONG, BYVAL TrueFalse AS LONG)
    LOCAL UseState AS LONG
    IF TrueFalse THEN UseState = %BST_CHECKED ELSE UseState = %BST_UNCHECKED
    CALL SendMessage(hBut, %BM_SETCHECK, UseState, 0)
END SUB

EXTRA BONUS: SKIN AERO

And here is the result :


« Last Edit: February 09, 2020, 05:56:14 pm by Patrice Terrier »
Patrice
(Always working with the latest Windows version available...)

Patrice Terrier

  • Administrator
  • *****
  • Posts: 1992
    • zapsolution
Re: [SDK] 09 - Take control of your CHECKBOX BUTTON
« Reply #1 on: February 09, 2020, 06:18:52 pm »
.
Patrice
(Always working with the latest Windows version available...)