Jump to content

Menu Opened for a second then closed


rliiack
 Share

Recommended Posts

This is my code:

#include <GUIConstantsEx.au3>     
menuCreator()  
Func menuCreator() 
Local $slider  
GUICreate("Smart Icons",200, 500, 100, 100) 
GUISetBkColor(0x00E0FFFF) 
$slider = GUICtrlCreateSlider(50, 20, 100, 10) 
GUICtrlSetLimit($slider,100,0) 
GUISetState(@SW_SHOW) 
GUICtrlSetData($slider, 45)  
EndFunc

How come my menu opened for one second then closed? Am I missing some code?

Thanks

My Projects:Smart Icons

Link to comment
Share on other sites

You need to include a loop. The problem is that the script finishes and exits just after you create it.

#include <GUIConstantsEx.au3>


menuCreator()

While 1
   If GUIGetMsg () = -3 Then ExitLoop
WEnd


Func menuCreator()
   Local $slider
   GUICreate("Smart Icons",200, 500, 100, 100)
   GUISetBkColor(0x00E0FFFF)
   $slider = GUICtrlCreateSlider(50, 20, 100, 20)
   GUICtrlSetLimit($slider,100,0)
   GUISetState(@SW_SHOW)
   GUICtrlSetData($slider, 45)
EndFunc

Mat

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...