qwert Posted October 20, 2011 Share Posted October 20, 2011 Setting the width and heigth causes it to occupy more space, but the checkbox itself is still small. I've tried both GUISetFont and GUICtrlSetFont with no success, even though the help file says:By default, controls use the font set by GUISetFontThanks for any help. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 20, 2011 Moderators Share Posted October 20, 2011 qwert, As far as I know you cannot change the size of an API-created checkbox. If you want a larger one you need to create your own custom version - perhaps along these lines: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateLabel("", 9, 9, 22, 22) GUICtrlSetBkColor(-1, 0) GUICtrlSetState(-1, $GUI_DISABLE) $hCheck = GUICtrlCreateLabel("", 10, 10, 20, 20, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 16) GUICtrlCreateLabel("A user-drawn checkbox", 35, 15, 200, 20) GUICtrlCreateCheckbox("An API-created checkbox", 10, 100, 200, 20) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hCheck Switch GUICtrlRead($hCheck) Case "" GUICtrlSetData($hCheck, "X") Case Else GUICtrlSetData($hCheck, "") EndSwitch EndSwitch WEnd A lot more work, but a pretty pleasing result. M23 Morthawt 1 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
qwert Posted October 20, 2011 Author Share Posted October 20, 2011 I was afraid that might be the case, since so few dialogs have anything other than the "tiny standard". It's hard to believe Windows has gotten away with such a limited implementation for all these years. I had already thought of toggling between two graphics. When I get more time, I'll use your script to test and refine that technique. I appreciate your response. Link to comment Share on other sites More sharing options...
Morthawt Posted October 20, 2011 Share Posted October 20, 2011 qwert, As far as I know you cannot change the size of an API-created checkbox. If you want a larger one you need to create your own custom version - perhaps along these lines: #include <GUIConstantsEx.au3> #include <StaticConstants.au3> $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateLabel("", 9, 9, 22, 22) GUICtrlSetBkColor(-1, 0) GUICtrlSetState(-1, $GUI_DISABLE) $hCheck = GUICtrlCreateLabel("", 10, 10, 20, 20, BitOR($SS_CENTER, $SS_CENTERIMAGE)) GUICtrlSetFont(-1, 16) GUICtrlCreateLabel("A user-drawn checkbox", 35, 15, 200, 20) GUICtrlCreateCheckbox("An API-created checkbox", 10, 100, 200, 20) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $hCheck Switch GUICtrlRead($hCheck) Case "" GUICtrlSetData($hCheck, "X") Case Else GUICtrlSetData($hCheck, "") EndSwitch EndSwitch WEnd A lot more work, but a pretty pleasing result. M23 Wow this is really good. Took me a minute to get my head around what it was doing.. Does the possibilities of Autoit never end?! You got me thinking now about what kinds of things like this I have missed. Nice job! Free and easy Autoit scripting video tutorials (plus more videos always coming!) General video tutorials, especially correct and safe TeamSpeak permissions tutorials. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted October 20, 2011 Moderators Share Posted October 20, 2011 Morthawt,Does the possibilities of Autoit never end?!I rather think not! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
funkey Posted October 20, 2011 Share Posted October 20, 2011 You can use the font 'Marlett' to have the original characters. $hGUI = GUICreate("Test", 200, 150) $hCheck1 = GUICtrlCreateLabel("", 10, 10, 20, 20, 0x1201) GUICtrlSetFont(-1, 19, 400, 0, "Marlett") GUICtrlSetBkColor(-1, 0xFFFFFF) $hLbl1 = GUICtrlCreateLabel("A user-drawn checkbox", 35, 15, 200, 20) $hCheck2 = GUICtrlCreateLabel("", 10, 50, 25, 25, 0x1201) GUICtrlSetFont(-1, 24, 400, 0, "Marlett") GUICtrlSetBkColor(-1, 0xFFFFFF) $hLbl2 = GUICtrlCreateLabel("Another user-drawn checkbox", 40, 57, 200, 20) GUICtrlCreateCheckbox("An API-created checkbox", 10, 100, 200, 20) GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit Case $hCheck1, $hLbl1 Switch GUICtrlRead($hCheck1) Case "" GUICtrlSetData($hCheck1, "a") Case Else GUICtrlSetData($hCheck1, "") EndSwitch Case $hCheck2, $hLbl2 Switch GUICtrlRead($hCheck2) Case "" GUICtrlSetData($hCheck2, "r") Case Else GUICtrlSetData($hCheck2, "") EndSwitch EndSwitch WEnd shotiko 1 Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now