[AHK-] GUI Text 重新排列

看板EzHotKey作者 (IV)時間13年前 (2012/08/16 16:50), 編輯推噓1(103)
留言4則, 2人參與, 最新討論串1/1
請問大家 假如原本在GUI中有七項text分別為 aaa bbb ccc ddd eee fff ggg 在window spy看它們的ClassNN分別為 Static1 Static2 Static3 Static4 Static5 Static6 Static7 我想把們重新排列為 fff ccc bbb ddd aaa eee 因此使用了GuiControl,Move 來去做他們的排列 也很成功的排列 但卻有時候(10%出現機率)會出現錯誤的狀況,但使用window spy看內容卻是正常 像是會變成 aaa (ClassNN:Static6 Text:fff) bbb (ClassNN:Static3 Text:ccc) bbb (ClassNN:Static2 Text:bbb) ddd (ClassNN:Static4 Text:ddd) aaa (ClassNN:Static1 Text:aaa) eee (ClassNN:Static5 Text:eee) 當系統繁忙有點lag時就會出現 (下面的例子中在GuiControl,Move每行加個sleep時間表系統繁忙處理狀態,就會更容易出 現) 這該怎麼解決呢? 謝謝 ------------------------------------------------------------------------------- Gui, Add, Text, x21 y14 w150 h30 , aaa Gui, Add, Text, x21 y54 w150 h30 , bbb Gui, Add, Text, x21 y94 w150 h30 , ccc Gui, Add, Text, x21 y134 w150 h30 , ddd Gui, Add, Text, x21 y174 w150 h30 , eee Gui, Add, Text, x21 y214 w150 h30 , fff Gui, Add, Button, x11 y254 w150 h30 , Change Gui, Show, xcenter ycenter autosize, demo Return GuiClose: ExitApp ButtonChange: Guicontrol,move,Static1,x21 y174 w200 h30 Guicontrol,move,Static2,x21 y94 w200 h30 Guicontrol,move,Static3,x21 y54 w200 h30 Guicontrol,move,Static4,x21 y134 w200 h30 Guicontrol,move,Static5,x21 y214 w200 h30 Guicontrol,move,Static6,x21 y14 w200 h30 return -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.43.21.207

08/17 18:57, , 1F
如果改成改變文字內容而不是改變位置呢?
08/17 18:57, 1F

08/18 00:22, , 2F
這真是個好方法! 這樣錯誤的顯示就不會出現了
08/18 00:22, 2F

08/18 00:30, , 3F
我這個算是AHK內部的問題(BUG)嗎? 還是我的想法哪邊有問題呢?
08/18 00:30, 3F

08/18 00:32, , 4F
用上GuiControl,Text 沒問題,但Guicontrol,Move 有時就怪怪的
08/18 00:32, 4F
文章代碼(AID): #1GBBH0ev (EzHotKey)
文章代碼(AID): #1GBBH0ev (EzHotKey)