Sign in to follow this  
Followers 0
lrstndm

Can't click button in Create Gradient

3 posts in this topic

#1 ·  Posted (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 by lrstndm

Share this post


Link to post
Share on other sites



The answer was in the help file. After your statement of GUICtrlCreateGraphic($nX, $nY, $nWidth, $nHeight), add this line:

GuiCtrlSetState(-1,$GUI_DISABLE)

RAID Calculator | Software Installer

The truth has been suppressed since the dawn of time.

Share this post


Link to post
Share on other sites

Thanks that worked for me:)

Share this post


Link to post
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
Sign in to follow this  
Followers 0