Disable keyboard focus when leftclick on hidden buttons

Get help with using AutoHotkey and its commands and hotkeys
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Disable keyboard focus when leftclick on hidden buttons

10 Jun 2017, 12:28

Cant seem to find any info on how to avoid hidden Gui button controls gets keyboard focus when left clicked. It results in user does not know which button has keyboard focus since these are hidden and masked (focus rectangle is the same color as the masking), so when keyboard navigating, up and down arrow has to be pressed multiple times (toggeling the hidden buttons) til focus rectangle shows up on the first or last visible button. Really frustrating this.
Helgef
Posts: 4459
Joined: 17 Jul 2016, 01:02
Contact:

Re: Disable keyboard focus when leftclick on hidden buttons

10 Jun 2017, 14:00

Can't you disable them? I probably didn't get the issue though. Cheers
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Re: Disable keyboard focus when leftclick on hidden buttons

10 Jun 2017, 14:49

Hi Helgef :)

Huh, when doing a rudimentary gui with buttons it works :o

Code: Select all

#NoEnv
Gui, Add, Button, vB1 Default, OK
Gui, Add, Button, vB2, &Pause
Gui, Add, Button, vB3, &Stop
Gui, Add, Button, vB4, &Next
Gui, Add, Button, vB5, &Hidden1
Gui, Add, Button, vB6, &Hidden2
Gui, Add, Button, vB7, &Hidden3
Gui, Add, Button, vB8, &Hidden4
GuiControlShowHide("B5|B6|B7|B8","hide")
Gui, Show, w100 h300

GuiControlShowHide(controls,showhide="Hide"){
	Loop,Parse,controls,|
	GuiControl, %showhide%,%A_LoopField%
}
Hmm...my app is huge and very complicated and extrating a sample will take time. I guessing this issue is related to me using or not fully understanding how to use just me´s Subclassed Flat Coloured pushButtons function https://autohotkey.com/boards/viewtopic.php?f=5&t=32564
RefData to suppress the focus rectangle is False/disabled and the rectangle is not drawn upon leftclick on hidden buttons, but the hidden Subclassed Flat Coloured pushButton takes the keyboard focus anyway, which surprises me greatly.
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Re: Disable keyboard focus when leftclick on hidden buttons

11 Jun 2017, 02:02

Sorry, I did a stupid mistake applying the GuiControlShowHide() inside a loop. Rendering the buttons only masked and not hidden :facepalm:

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], haichen, julianpa, RubbeH, Senior47, Xtra and 45 guests