Tyranna Posted June 1, 2017 Share Posted June 1, 2017 I need to make a button with a checkbox. The button will have a $BS-BITMAP on it. Anything I make and position on the button disappears behind it when the mouse runs over it. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 1, 2017 Moderators Share Posted June 1, 2017 Tyranna, Can you explain why you wish to have a checkbox on a button? If we understand the purpose, we might be able to suggest an alternative solution - using the $BS_SPLITBUTTON style sounds as if it might fit the bill. 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...
Tyranna Posted June 1, 2017 Author Share Posted June 1, 2017 The Button is going to perform the function, and if the box is checked, then it will be monitored and activated automatically at specified intervals by the script, so I will not have to push the button manually. It allows me to perform the function once if I want, but if I want it to run auto, I can check the box. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 1, 2017 Moderators Share Posted June 1, 2017 Tyranna, Why can you not just place the checkbox beside the button? 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...
Tyranna Posted June 1, 2017 Author Share Posted June 1, 2017 Because I want to make a compact , superior interface. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 1, 2017 Moderators Share Posted June 1, 2017 Tyranna, How about this SplitButton example as "a compact, superior interface"? expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> #include <MsgBoxConstants.au3> #include <GuiMenu.au3> $hGUI = GUICreate("Test", 500, 500) $cSplitButton = GUICtrlCreateButton("Run Auto", 10, 10, 120, 30, $BS_SPLITBUTTON) GUISetState() GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $cSplitButton _Run_Select() EndSwitch WEnd Func _Run_Select() Switch GUICtrlRead($cSplitButton) Case "Run Auto" MsgBox($MB_SYSTEMMODAL, "Selected", "Auto") Case "Run Once" MsgBox($MB_SYSTEMMODAL, "Selected", "Once") EndSwitch EndFunc Func _Run_Menu($hCtrl) Local Enum $iOption_1 = 1000, $iOption_2 Local $hMenu = _GUICtrlMenu_CreatePopup() _GUICtrlMenu_InsertMenuItem($hMenu, 0, "Run Auto", $iOption_1) _GUICtrlMenu_InsertMenuItem($hMenu, 1, "Run Once", $iOption_2) Switch _GUICtrlMenu_TrackPopupMenu($hMenu, $hCtrl, -1, -1, 1, 1, 2) Case $iOption_1 GUICtrlSetData($cSplitButton, "Run Auto") Case $iOption_2 GUICtrlSetData($cSplitButton, "Run Once") EndSwitch _GUICtrlMenu_DestroyMenu($hMenu) _Run_Select() EndFunc ;==>List_Insert_Menu Func _WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $tStruct = DllStructCreate($tagNMHDR, $lParam) If @error Then Return Switch DllStructGetData($tStruct, "Code") Case $BCN_DROPDOWN _Run_Menu(DllStructGetData($tStruct, "hWndFrom")) EndSwitch EndFunc M23 Skysnake 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...
Skysnake Posted June 1, 2017 Share Posted June 1, 2017 Dear @Melba23 that sure is pretty. nice code Skysnake Skysnake Why is the snake in the sky? Link to comment Share on other sites More sharing options...
Tyranna Posted June 1, 2017 Author Share Posted June 1, 2017 That is not bad, and it would probably do what i want, but what I am doing is mapping an 2 different images to the same button depending if a flag is set, the flag is checked from within the message loop, and also the image is changed if it is in auto. So, 0 and 0 = not active , not auto 0 and 1 = not active , auto 1 and 0 = active , not auto 1 and 1 = active , auto Really , I wanted a Gold border around the button when selected , No border when not. (For Auto) A dark image if the flag is not set. And a bright image when is set. I ended up making 4 images to put on the button, 1 for every state and change it by checking both every time.... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 1, 2017 Moderators Share Posted June 1, 2017 Tyranna, Glad you got what you wanted - even if it sounds a bit complicated. 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...
Tyranna Posted June 1, 2017 Author Share Posted June 1, 2017 There are some definite limitations for graphics manipulation in AutoIt. Thanks for the Split Example , I saved it and will look at it further. Probably will not use it for this specific project, but I like that functionality. 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