Advertisement
phatjk

[Autoit] Multi-GUI/Form

Jul 25th, 2018
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.12 KB | None | 0 0
  1. #include <ButtonConstants.au3>
  2. #include <GUIConstantsEx.au3>
  3. #include <WindowsConstants.au3>
  4. #Region ### START Koda GUI section ### Form=
  5. $Form1 = GUICreate("main", 230, 44, 180, 117)
  6. $Button1 = GUICtrlCreateButton("Gui 1", 8, 8, 75, 25)
  7. $Button2 = GUICtrlCreateButton("Gui 2", 136, 8, 75, 25)
  8. GUISetState(@SW_SHOW)
  9. #EndRegion ### END Koda GUI section ###
  10.  
  11. While 1
  12.     $nMsg = GUIGetMsg()
  13.     Switch $nMsg
  14.         Case $GUI_EVENT_CLOSE
  15.             Exit
  16.         Case $Button1
  17.             Gui1()
  18.         Case $Button2
  19.             Gui2()
  20.     EndSwitch
  21. WEnd
  22. Func Gui1()
  23. $Form1 = GUICreate("Form1", 149, 96, 192, 124)
  24. $Label1 = GUICtrlCreateLabel("Gui 1", 40, 24, 48, 29)
  25. GUICtrlSetFont(-1, 14, 400, 0, "Segoe UI")
  26. GUISetState(@SW_SHOW)
  27. While 1
  28.     $nMsg = GUIGetMsg()
  29.     Switch $nMsg
  30.         Case $GUI_EVENT_CLOSE
  31.             ExitLoop
  32.     EndSwitch
  33. WEnd
  34. GUIDelete($Form1)
  35. EndFunc
  36. Func Gui2()
  37. $Form1 = GUICreate("Form1", 149, 96, 192, 124)
  38. $Label1 = GUICtrlCreateLabel("Gui 2", 40, 24, 48, 29)
  39. GUICtrlSetFont(-1, 14, 400, 0, "Segoe UI")
  40. GUISetState(@SW_SHOW)
  41. While 1
  42.     $nMsg = GUIGetMsg()
  43.     Switch $nMsg
  44.         Case $GUI_EVENT_CLOSE
  45.             ExitLoop
  46.     EndSwitch
  47. WEnd
  48. GUIDelete($Form1)
  49. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement