Well there's a lot of autohotkey sites saying that you can apply a transparency and then capture special mouse events to emulate the mouseover and mouseout effects of a button with an image as a background. I couldn't get any of these working and they looked more confusing then anything else.
My solution is to set up the default button and the image to respond to the ENTER key after you typed something (this is for a search feature) in addition to having a button if the user would rather click then press the ENTER key. Then create the mouseover and mouseout effects afterwards.
Add the image for your GUI:
Gui, Add, Picture, x600 y70 w90 h90 vSearchButton gSearch, %A_ScriptDir%\images\program\search_button.png
- Gui, Add, Picture, x600 y70 w90 h90 vSearchButton gSearch, %A_ScriptDir%\images\program\search_button.png
Add the input field where you type the text:
Gui, Add, Edit, x55 y95 r1 w550 vSearchTextInput, Search...
- Gui, Add, Edit, x55 y95 r1 w550 vSearchTextInput, Search...
Add the submit button with a hidden attribute:
Gui, Add, Button, x600 y70 w90 h90 +Default +gSearch +Hide, Search
- Gui, Add, Button, x600 y70 w90 h90 +Default +gSearch +Hide, Search
The function to receive the data can be:
Search: Gui, Submit, NoHide MsgBox, Searching for "%SearchTextInput%" Return
- Search:
- Gui, Submit, NoHide
- MsgBox, Searching for "%SearchTextInput%"
- Return