Sign in to follow this  
Followers 0
Mic

check box with $BS_PUSHLIKE - change button color?

3 posts in this topic

$cb1 = GUICtrlCreateCheckbox("cb",30,35,18,18,8425760,-1) gives pushbutton-like checkbox. Is there a DLLCall that will change the color of the 'on' to green? At the moment it is blue. tia.
 

Share this post


Link to post
Share on other sites



When you post something like this, you should provide a runnable example code, which can be modified.

Otherwise people might not have the time or patience to create a gui themselves, where they would offer help more quickly had they just have to modify existing code, or add a line of code.

Doesent appear to work with your style of checkbox, you could just use a button.

#include <GUIConstantsEx.au3>

Example()

Func Example()
    Local $msg

    GUICreate("My GUI background color") ; will create a dialog box that when displayed is centered
    
    ;$cb1 = GUICtrlCreateCheckbox("cb",30,35,18,18,8425760,-1)
    $cb1 = GUICtrlCreateButton("cb",30,35,18,18,8425760,-1)
    GUICtrlSetBkColor($cb1, 0x00ff00) ; Green

    GUISetState()

    ; Run the GUI until the dialog is closed
    While 1
        $msg = GUIGetMsg()

        If $msg = $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
EndFunc   ;==>Example

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Share this post


Link to post
Share on other sites
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiButton.au3>


$PtnVsn = GUICreate("PtnVsn",1000,800,-1,-1,-1,-1)
; ISN Studio converts $BS_RIGHT+$BS_CENTER+$WS_BORDER+$BS_VCENTER+$BS_FLAT+$BS_RIGHTBUTTON to 8425760
$cbTest1 = GUICtrlCreateCheckbox("0",445,569,18,18,8425760,-1) ;  
GUISetState(@SW_SHOW,$PtnVsn)


While 1
  $nMsg = GUIGetMsg()
  Switch $nMsg
    Case $GUI_EVENT_CLOSE
      Exit
  EndSwitch
WEnd
 
Chose the checkbox with $BS_PUSHLIKE because it makes a great LED indicator, but I would like the LED on to be green or red. The default blue of the button comes from a default Windows style I think(?). Is it possible to change this? tia.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0