[AHK-] GUI BUTTON 選擇

看板EzHotKey作者 (IV)時間13年前 (2012/07/08 15:32), 編輯推噓2(200)
留言2則, 1人參與, 最新討論串1/2 (看更多)
Gui, Add, Button, x11 y14 w170 h50 , 按鈕1 Gui, Add, Button, x11 y134 w170 h50 default, 按鈕2 Gui, Add, Button, x11 y74 w170 h50 , 按鈕3 Gui, Show, xcenter ycenter autosize, test window Return GuiClose: ExitApp ---------------------------------------------------------- 請問大家 當GUI視窗打開時預設按鈕為按鈕2 但是如果不要選擇預設的按鈕2 想選擇其他的按鈕時 使用鍵盤上面的方向鍵上下作為挑選時 卻會出現奇怪的次序變換 上:確定2→確定3→確定2→確定1→確定3→確定2→確定1→確定3→確定2→... 下:確定2→確定3→確定1→確定2→確定3→確定1→... 跟一般經驗上使用方式完全相反 這該怎麼解決呢? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.43.11.111

07/08 19:33, , 1F
把你的按鈕程式碼照順序排好
07/08 19:33, 1F
感謝F大 原來要按照X,Y的位置排好 -------------------------------------------------------------------------- 我想再問一個問題 當我程式碼按照順序排好後 雖然執行時預設的按鈕是按鈕2 但假如我選擇別的視窗為最上層(譬如說是PCMAN) 然後再選擇test window為最上層 則會變成按鈕1為預設的按鈕 請問這該怎麼辦呢? Gui, Add, Button, x11 y14 w170 h50 , 按鈕1 Gui, Add, Button, x11 y74 w170 h50 , 按鈕3 Gui, Add, Button, x11 y134 w170 h50 default, 按鈕2 Gui, Show, xcenter ycenter autosize, test window Return GuiClose: ExitApp ※ 編輯: KTiC 來自: 114.37.9.186 (07/10 10:34)

07/10 19:42, , 2F
把按鈕2的程式碼移到最上面
07/10 19:42, 2F
再次感謝F大成功解決了^_^ 如果我把按鈕增加到4個後又出現奇怪的徵狀了 >_< 這次我先把x,y位置先排好 -------------------------------------------------------------------- Gui, Add, Button, x11 y14 w170 h50 , 按鈕1 Gui, Add, Button, x11 y74 w170 h50 , 按鈕3 Gui, Add, Button, x11 y134 w170 h50 default, 按鈕2 Gui, Add, Button, x11 y194 w170 h50 , 按鈕4 Gui, Show, xcenter ycenter autosize, test window Return GuiClose: ExitApp -------------------------------------------------------------------- 上:按鈕2→按鈕4→按鈕2→按鈕3→按鈕1→按鈕4→按鈕2→按鈕3→按鈕1→... 下:按鈕2→按鈕3→按鈕2→按鈕4→按鈕1→按鈕3→按鈕2→按鈕4→按鈕1→... 而且還會出現之前跳到別的視窗再跳回來後變成按鈕1為預設按鈕 這次我改了按鈕2那行放最上面後還是不行 雖然跳到別的視窗再跳回來的預設按鈕變成按鈕1的問題解決了 但卻變成 上:按鈕2→按鈕4→按鈕3→按鈕1→... 下:按鈕2→按鈕1→按鈕3→按鈕4→... 還煩請您再開釋一下 謝謝 --------------------------------------------------------------------- Gui, Add, Button, x11 y134 w170 h50 default, 按鈕2 Gui, Add, Button, x11 y14 w170 h50 , 按鈕1 Gui, Add, Button, x11 y74 w170 h50 , 按鈕3 Gui, Add, Button, x11 y194 w170 h50 , 按鈕4 Gui, Show, xcenter ycenter autosize, test window Return GuiClose: ExitApp ---------------------------------------------------------------------- ※ 編輯: KTiC 來自: 114.43.20.168 (07/17 21:12)
文章代碼(AID): #1F-JUYar (EzHotKey)
討論串 (同標題文章)
以下文章回應了本文
完整討論串 (本文為第 1 之 2 篇):
2
2
文章代碼(AID): #1F-JUYar (EzHotKey)