Jump to content

How to make BIG controls?


Recommended Posts

... you seemed to be limited by your imagination... Autoit isn't!

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

Opt('MustDeclareVars', 1)

Global $checked

_Main()

Func _Main()
    Local $button1, $button2, $button3, $button4
    Local $button5, $buttonclose

    GUICreate("test", 240, 180)
    
    $buttonclose = GUICtrlCreateButton("close", 200, 0, 40, 40, $BS_ICON)
    GUICtrlSetImage(-1, "shell32.dll", 28)
    GUICtrlCreateLabel("Please Press to EXIT", 10, 10, 180, 40)
    GUICtrlSetFont( -1, 12, 700)
    
    
    $button1 = GUICtrlCreateButton("1", 200, 90, 40, 40, $BS_ICON)
    GUICtrlSetImage(-1, "shell32.dll", 35)
    GUICtrlCreateLabel("Please Press Checkbox", 10, 100, 190, 40)
    GUICtrlSetFont( -1, 12, 700)
    GUISetState()

    ; Run the GUI until the dialog is closed
    While 1
        Switch GUIGetMsg()
            Case $buttonclose, $GUI_EVENT_CLOSE
                ExitLoop
            Case $button1
                If $checked Then
                    GUICtrlSetImage( $button1, "shell32.dll", 35)
                    $checked = 0
                Else
                    GUICtrlSetImage( $button1, "shell32.dll", 22)
                    $checked = 1
                EndIf
            Case Else
        EndSwitch
    WEnd

    GUIDelete()
EndFunc   ;==>_Main

8)

Edited by Valuater

NEWHeader1.png

Link to comment
Share on other sites

I'm not sure what you mean about my imagination. I'm just looking for help with AutoIT. I have been able to set the font and that tip was quite helpful, but what I'm really looking for is a way to make the standard checkboxes, radio buttons etc. bigger. As in, the actual square checkbox that the user would actually click.

Link to comment
Share on other sites

You could do it this way :P

#include <GUIConstantsEx.au3>
#include <ButtonConstants.au3>

Opt('MustDeclareVars', 1)

Global $checked

_Main()

Func _Main()
    Local $CheckBox, $CheckBox_LBL
    Local $button5, $buttonclose

    GUICreate("test", 240, 180)
   
    $buttonclose = GUICtrlCreateButton("close", 200, 0, 40, 40, $BS_ICON)
    GUICtrlSetImage(-1, "shell32.dll", 28)
    GUICtrlCreateLabel("Please Press to EXIT", 10, 10, 180, 40)
    GUICtrlSetFont( -1, 12, 700)
   
   
    $CheckBox = GUICtrlCreateCheckbox("1", 200, 90, 40, 40, $BS_ICON+$BS_PUSHLIKE)
    GUICtrlSetImage(-1, "shell32.dll", -35)
    $CheckBox_LBL = GUICtrlCreateLabel("Please Press Checkbox", 10, 100, 190, 40)
    GUICtrlSetFont( -1, 12, 700)
    GUISetState()

    ; Run the GUI until the dialog is closed
    While 1
        Switch GUIGetMsg()
            Case $buttonclose, $GUI_EVENT_CLOSE
                ExitLoop
            Case $CheckBox_LBL ; Register lbl Click :)
                ControlClick(GUICtrlGetHandle($CheckBox),"","")
            Case $CheckBox
                If BitAND(GUICtrlRead($CheckBox),$GUI_CHECKED) = $GUI_CHECKED Then
                    GUICtrlSetImage( $CheckBox, "shell32.dll", -49)
                Else
                    GUICtrlSetImage( $CheckBox, "shell32.dll", -35)
                EndIf
            Case Else
        EndSwitch
    WEnd

    GUIDelete()
EndFunc   ;==>_Main

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...