Advertisement
Andrei11114

Gui Button cant be pressed when GUICtrlCreatePic is used

May 1st, 2013
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 0.61 KB | None | 0 0
  1. #include <WinApi.au3>           ;need for _WinAPI_SetParent
  2. Local $gui = GUICreate("2 button gui with bk image", 400, 400)
  3. ;                       V - here, don't forget it
  4. Local $Pic = GUICtrlCreatePic(@ScriptDir & "\pic.jpg", 0, 0, 400, 400)   ;save the ctrlId
  5. Local $Button1 = GUICtrlCreateButton("Button1", 100, 350, 80, 30)
  6. Local $Button2 = GUICtrlCreateButton("Button2", 220, 350, 80, 30)
  7. _WinAPI_SetParent(GuiCtrlGetHandle($Button1),GuiCtrlGetHandle($Pic))    ;Set the parrent
  8. GUISetState()
  9.  
  10. While 1
  11. Switch GUIGetMsg()
  12.     Case -3 ;;$GUI_EVENT_CLOSE = -3
  13.         Exit
  14.     Case $Button1
  15.         Exit
  16.     Case $Button2
  17.         Exit
  18.     EndSwitch
  19.  
  20. WEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement