lrstndm Posted November 29, 2012 Share Posted November 29, 2012 (edited) All, I have a problem with my autoit code. with the createGradient method I created 2 different colors in 1 GUI. But when I set 2 buttons on both the colors I can not click the button on the created gradient. below is my autoit code. Can this be fixed? Thanks in advance, lrstndm #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $form = GUICreate("Test", 300, 300, -1, -1) GUISetBkColor(0xF0F0F0, $form) GUICtrlCreateGradient(0, 0, 150, 371) $button1 = GUICtrlCreateButton("Button 1", 30, 150, 75, 25) $button2 = GUICtrlCreateButton("Button 2", 200, 200, 75, 25) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE Exit Case $msg = $button1 MsgBox(0, 'button1', 'button 1 clicked') Case $msg = $button2 MsgBox(0, 'button2', 'button 2 clicked') EndSelect WEnd Func GUICtrlCreateGradient($nX, $nY, $nWidth = 255, $nHeight = 20) GUICtrlCreateGraphic($nX, $nY, $nWidth, $nHeight) For $i = 0 To $nHeight GUICtrlSetGraphic(-1, $GUI_GR_COLOR, 0xFFFFFF, 0xFFFFFF5) GUICtrlSetGraphic(-1, $GUI_GR_MOVE, 0, $i) GUICtrlSetGraphic(-1, $GUI_GR_LINE, $nWidth, $i) Next EndFunc Edited November 29, 2012 by lrstndm Link to comment Share on other sites More sharing options...
abberration Posted November 29, 2012 Share Posted November 29, 2012 The answer was in the help file. After your statement of GUICtrlCreateGraphic($nX, $nY, $nWidth, $nHeight), add this line:GuiCtrlSetState(-1,$GUI_DISABLE) Easy MP3 | Software Installer | Password Manager Link to comment Share on other sites More sharing options...
lrstndm Posted November 30, 2012 Author Share Posted November 30, 2012 Thanks that worked for me:) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now