Hide Button on a Named GUI - ARGGGHHHH

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
cdjagain
Posts: 8
Joined: 16 Jul 2014, 17:39

Hide Button on a Named GUI - ARGGGHHHH

13 May 2019, 11:48

I'm trying to develop a gui that presents users with a list of browser tabs where the tab contains a certain phrase. Clicking one of the gui buttons will activate that tab in a browser. Used in a work context.

I can get the list of tabs and show in a gui. Great !

The trick is to how to handle a tab being closed. If I destroy and then recreate periodically the gui winks in and out, which is visually annoying. I'd rather HIDE a button and let the window resize.

I cannot :wtf: get the code correct to hide a button with text "xyz" on a GUI named "mygui"

Code: Select all

guicontrol, Hide, mygui%A_loopfield% 

Code: Select all


Gui, mygui:+LastFound                                                                                 ;<------------------- GUI is named "mygui"
myguiID := WinExist()	;store the ID of "mygui" window

wingettext, buttonlist, %myTitle%           ;get the text off the buttons

loop, parse, buttonlist, `n, `r
{
if (instr(tablist , A_Loopfield)>0)                       ;tablist is from Acc, pulls the list of tabs correctly
	{
	;tab still exists, do nothing to this button
	}	
	else
	{
	msgbox Need to delete/hide %A_loopfield%
	guicontrol, Hide, mygui%A_loopfield%             ;<----------HOW TO HIDE THE BUTTON  ARRRRGGHHHH !!!! 
	tablist:=strreplace(tablist,A_loopfield) ;tidy up the list
	}
}

}   ;loop
kyuuuri
Posts: 340
Joined: 09 Jan 2016, 19:20

Re: Hide Button on a Named GUI - ARGGGHHHH

14 May 2019, 05:43

You need to write a ":" After gui's name.
It should be like this: GuiControl, hide, MyGui:<ReplaceMeWithControl'sAssociated Variable>

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: ccqcl, Descolada, mikeyww and 370 guests