Jump to content

Background image interferes with mouse detection for buttons/other clickables


Recommended Posts

Playing around with AutoIT for the first time.

So basically I've made a simple window and a couple of buttons, nothing fancy.

After I've applied a background picture, the button and input box no longer respond to mouse presses or attempts to select the input.

If I remove the picture, functionality returns.

Here's a basic skeleton with a background image (the input accepts int only):

#include <GUIConstants.au3>


$maindindow = GUICreate("Oreover", 515, 260, 271, 307)
GUISetBkColor(0x000000)

$Pic1 = GUICtrlCreatePic("C:\WINDOWS\Web\Wallpaper\Azul.jpg", 8, 8, 500, 244)
$Group1 = GUICtrlCreateGroup("", 24, 24, 465, 201, -1, $WS_EX_TRANSPARENT)

$Input1 = GUICtrlCreateInput("45", 150, 130, 40, 17, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
            GUICtrlSetLimit($Input1, 3)

$Button1 = GUICtrlCreateButton("Apply", 200, 130, 75, 17, 0)


GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        
        Case $Button1
    EndSwitch
WEnd
Link to comment
Share on other sites

#include <GUIConstants.au3>


$maindindow = GUICreate("Oreover", 515, 260, 271, 307)
GUISetBkColor(0x000000)

$Pic1 = GUICtrlCreatePic("C:\WINDOWS\Web\Wallpaper\Azul.jpg", 8, 8, 500, 244)
GUICtrlSetState( $Pic1, $GUI_DISABLE)

$Group1 = GUICtrlCreateGroup("", 24, 24, 465, 201, -1, $WS_EX_TRANSPARENT)

$Input1 = GUICtrlCreateInput("45", 150, 130, 40, 17, BitOR($ES_CENTER,$ES_AUTOHSCROLL,$ES_NUMBER))
            GUICtrlSetLimit($Input1, 3)

$Button1 = GUICtrlCreateButton("Apply", 200, 130, 75, 17, 0)


GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
       
        Case $Button1
    EndSwitch
WEnd

8)

NEWHeader1.png

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...