Hide multiple controls parallel?

Ask for help, how to use AHK_H, etc.
MadMarcsen
Posts: 3
Joined: 16 Mar 2023, 16:48

Hide multiple controls parallel?

16 Jul 2023, 06:04

Hi,

imagine you have a GUI with a lot of controls and you wan't to hide/unhide them. In AHK this is really slow, is it possible to speed up the process by hide/unhide controls in parallel with threads in_H? I never used _H before, so this is completely new for me.

Example Code:

Code: Select all

; Allgemeine Einstellungen für Schriftart
USEDFONT := "Segoe UI"
FONTSIZE := "8"
FONTQUALITY := "q5"

MainWindow := Gui("+Resize +DPIScale +MinSize640x480")
MainWindow.SetFont("s" . FONTSIZE . " " . FONTQUALITY, USEDFONT)
MainWindow.MarginX := 10
MainWindow.MarginY := 10

myButton1 := MainWindow.Add("Button", "x10 y10", "OK")
myButton2 := MainWindow.Add("Button", "xp y+10", "OK")
myButton3 := MainWindow.Add("Button", "xp y+10", "OK")
myButton4 := MainWindow.Add("Button", "xp y+10", "OK")
myButton5 := MainWindow.Add("Button", "xp y+10", "OK")
myButton6 := MainWindow.Add("Button", "xp y+10", "OK")
myButton7 := MainWindow.Add("Button", "xp y+10", "OK")
myButton8 := MainWindow.Add("Button", "xp y+10", "OK")
myButton9 := MainWindow.Add("Button", "xp y+10", "OK")
myButton10 := MainWindow.Add("Button", "xp y+10", "OK")
myButton11 := MainWindow.Add("Button", "x40 y10", "OK")
myButton12 := MainWindow.Add("Button", "xp y+10", "OK")
myButton13 := MainWindow.Add("Button", "xp y+10", "OK")
myButton14 := MainWindow.Add("Button", "xp y+10", "OK")
myButton15 := MainWindow.Add("Button", "xp y+10", "OK")
myButton16 := MainWindow.Add("Button", "xp y+10", "OK")
myButton17 := MainWindow.Add("Button", "xp y+10", "OK")
myButton18 := MainWindow.Add("Button", "xp y+10", "OK")
myButton19 := MainWindow.Add("Button", "xp y+10", "OK")
myButton20 := MainWindow.Add("Button", "xp y+10", "OK")
myButton21 := MainWindow.Add("Button", "x70 y10", "OK")
myButton22 := MainWindow.Add("Button", "xp y+10", "OK")
myButton23 := MainWindow.Add("Button", "xp y+10", "OK")
myButton24 := MainWindow.Add("Button", "xp y+10", "OK")
myButton25 := MainWindow.Add("Button", "xp y+10", "OK")
myButton26 := MainWindow.Add("Button", "xp y+10", "OK")
myButton27 := MainWindow.Add("Button", "xp y+10", "OK")
myButton28 := MainWindow.Add("Button", "xp y+10", "OK")
myButton29 := MainWindow.Add("Button", "xp y+10", "OK")
myButton30 := MainWindow.Add("Button", "xp y+10", "OK")

Done := MainWindow.Add("Button", "x120 y10", "Go")
Done.OnEvent("Click", Go)

MainWindow.Show()
Return

Go(*)
{
    Loop 30
    {
        Name := "myButton" . A_Index
        If (ControlGetVisible(%Name%) == 1)
            ControlHide(%Name%)
        Else
            ControlShow(%Name%)
    }
}

Return to “Ask for Help”

Who is online

Users browsing this forum: No registered users and 43 guests