Page 1 of 1

Disable keyboard focus when leftclick on hidden buttons

Posted: 10 Jun 2017, 12:28
by zcooler
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.

Re: Disable keyboard focus when leftclick on hidden buttons

Posted: 10 Jun 2017, 14:00
by Helgef
Can't you disable them? I probably didn't get the issue though. Cheers

Re: Disable keyboard focus when leftclick on hidden buttons

Posted: 10 Jun 2017, 14:49
by zcooler
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.

Re: Disable keyboard focus when leftclick on hidden buttons

Posted: 11 Jun 2017, 02:02
by zcooler
Sorry, I did a stupid mistake applying the GuiControlShowHide() inside a loop. Rendering the buttons only masked and not hidden :facepalm: