FrostedBullets Posted April 27, 2009 Share Posted April 27, 2009 (edited) Ok so i recently have been playing around in autoit. made a simple layout with the correct window size and button layout. My question is how will i code it so each button has its own image and the main window has stretched background? GUICreate("background",300,200,-1,-1,); will create a dialog box that when displayed is centered Local $starbutton, $infobutton, $configbutton, $msg $Button_1=GUICtrlCreateButton ("Start", 0, -1, 100, 100) $Button_2=GUICtrlCreateButton ("Info", 100, -1, 100, 100) $Button_3=GUICtrlCreateButton ("Config", 200, -1, 100, 100) GuiSetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 MsgBox(0, 'Error', 'This Function is not done yet!') ; Will Run the script from config Case $msg = $Button_2 MsgBox(0, 'Error', 'This Function is not done yet!') ; Will Bring up the info window Case $msg = $Button_3 MsgBox(0, 'Error', 'This Function is not done yet!') ; Will bring up a config window EndSelect WEnd GUIDelete() Exit Edited April 27, 2009 by FrostedBullets Link to comment Share on other sites More sharing options...
Authenticity Posted April 27, 2009 Share Posted April 27, 2009 #572734Please use the search next time. Link to comment Share on other sites More sharing options...
FrostedBullets Posted April 29, 2009 Author Share Posted April 29, 2009 #572734 Please use the search next time. I got images to show over my buttons but when you mouse over they disappear any ideas? $ichant= GUICreate("iChant",300,200,-1,-1); creates main window GUICtrlCreatePic(@ScriptDir & "\Data\GUI\background.bmp", 0, 0, 300, 200) GuiCTRlSetState(-1, $GUI_DISABLE) $Button_1=GUICtrlCreateButton ("Start", 0, -1, 101, 81) GUICtrlCreatePic(@ScriptDir & "\Data\GUI\play.bmp", 0, -1, 101, 81) $Button_2=GUICtrlCreateButton ("Info", 100, -1, 100, 81) GUICtrlCreatePic(@ScriptDir & "\Data\GUI\help.bmp", 100, -1, 100, 81) $Button_3=GUICtrlCreateButton ("Config", 200, -1,99, 81) GUICtrlCreatePic(@ScriptDir & "\Data\GUI\config.bmp", 200, -1, 99, 81) GuiSetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 MsgBox(0, 'Error', 'This Function is not done yet!') ; Will Run the script from config Case $msg = $Button_2 MsgBox(0, 'iChant Help', 'Welcome to iChant. The semi-automatic enchanting leveler.') ; Will Bring up the info window Case $msg = $Button_3 MsgBox(0, 'iChant Help', 'Welcome to iChant. The semi-automatic enchanting leveler.') ; Will Bring up the info window EndSelect WEnd Link to comment Share on other sites More sharing options...
FrostedBullets Posted May 2, 2009 Author Share Posted May 2, 2009 Bump Link to comment Share on other sites More sharing options...
Authenticity Posted May 2, 2009 Share Posted May 2, 2009 (edited) You need to specify BS_BITMAP like:$Button_1=GUICtrlCreateButton ("Start", 0, 50, 101, 81, $BS_BITMAP) GUICtrlSetImage(-1, @ScriptDir & "\Data\GUI\play.bmp)Edit: Don't forget to include "ButtonConstants.au3". Edited May 2, 2009 by Authenticity 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