Chimaera Posted May 20, 2016 Share Posted May 20, 2016 Hi all Im working on a gui that i need to show that a button has been used before but still allows it to be used again Local $hButton_1 = GUICtrlCreateButton( "", 25, 30, 45, 45, $BS_BITMAP, $WS_EX_WINDOWEDGE) GUICtrlSetImage($hButton_1, $templocation & 'simplestart_img.bmp') im creating the button like this And i want it to go grey like this when you disable them GUICtrlSetState($hButton_1, $GUI_DISABLE) But i still want the button usable so not disabled. So to recap it needs to be greyed out like the disable but still accessible so it can be used Is there a simple way to do this? If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
AutoBert Posted May 20, 2016 Share Posted May 20, 2016 (edited) A Button with State $GUI_Disable is disabled. You can only try to give him a look like diabled. Try GuiCtrlSetBKColor and GuiCtrlSetBColor. You must also create a 2. bmp using in the "LookLikeDiabled"-State. Edited May 20, 2016 by AutoBert Link to comment Share on other sites More sharing options...
orbs Posted May 20, 2016 Share Posted May 20, 2016 On iPad, excuse typos and briefness. Leave button enabled but set button text color to purple like html links already visited. For better consistency, instead of button use blue underlined label. Signature - my forum contributions: Spoiler UDF: LFN - support for long file names (over 260 characters) InputImpose - impose valid characters in an input control TimeConvert - convert UTC to/from local time and/or reformat the string representation AMF - accept multiple files from Windows Explorer context menu DateDuration - literal description of the difference between given dates Apps: Touch - set the "modified" timestamp of a file to current time Show For Files - tray menu to show/hide files extensions, hidden & system files, and selection checkboxes SPDiff - Single-Pane Text Diff Link to comment Share on other sites More sharing options...
Chimaera Posted May 20, 2016 Author Share Posted May 20, 2016 4 hours ago, AutoBert said: A Button with State $GUI_Disable is disabled. You can only try to give him a look like diabled. Try GuiCtrlSetBKColor and GuiCtrlSetBColor. You must also create a 2. bmp using in the "LookLikeDiabled"-State. Ok thx ill have a look at doing that. What is the 2.bmp? a second version of the button? I was considering that path but it doubles the button bmps i have to include 3 hours ago, orbs said: On iPad, excuse typos and briefness. Leave button enabled but set button text color to purple like html links already visited. For better consistency, instead of button use blue underlined label. Unfortunatly they are all pictures with no text. Ill keep playing thx for the help If Ive just helped you ... miracles do happen. Chimaera CopyRobo() * Hidden Admin Account Enabler * Software Location From Registry * Find Display Resolution * _ChangeServices() Link to comment Share on other sites More sharing options...
johnmcloud Posted May 20, 2016 Share Posted May 20, 2016 (edited) ; Johnmcloud - 2016 #include <GUIConstantsEx.au3> $hGUI = GUICreate("", 180, 104, -1, -1) $Button = GUICtrlCreateButton("Click Me", 24, 16, 137, 65) GUICtrlSetState(-1, $GUI_DISABLE) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch $aInfo = GUIGetCursorInfo($hGUI) If IsArray($aInfo) And $aInfo[2] = 1 Then ; Primary down (1 if pressed, 0 if not pressed) Select Case $aInfo[4] = $Button ; ID of the control that the mouse cursor is hovering over (or 0 if none) _MouseRelease() ConsoleWrite("!Button clicked" & @CRLF) EndSelect EndIf WEnd Func _MouseRelease() Do $aInfo = GUIGetCursorInfo($hGUI) Sleep(10) Until $aInfo[2] = 0 ; Primary down - wait for release 0 if not pressed EndFunc ;==>_MouseRelease Think outside of the box! Edited May 20, 2016 by johnmcloud Link to comment Share on other sites More sharing options...
mikell Posted May 21, 2016 Share Posted May 21, 2016 (edited) A little simpler #include <GUIConstantsEx.au3> $hGUI = GUICreate("", 180, 104, -1, -1) $Button = GUICtrlCreateButton("Click Me", 24, 16, 137, 65) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button Msgbox(0,"", "Button clicked enabled") GUICtrlSetState($Button, $GUI_DISABLE) Case $GUI_EVENT_PRIMARYUP If GUIGetCursorInfo()[4] = $Button Then Msgbox(0,"", "Button clicked disabled") EndSwitch WEnd Edited May 21, 2016 by mikell typo 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