ludocus Posted April 19, 2008 Share Posted April 19, 2008 is there a way to put an image in your gui as a button? Link to comment Share on other sites More sharing options...
ProgAndy Posted April 19, 2008 Share Posted April 19, 2008 If it needen't look like a Button with a pushed state, just add $SS_NOTIFY in the normal Style *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
Swift Posted April 19, 2008 Share Posted April 19, 2008 Well If: GUICtrlCreatePic() Is what you want, then you can use hover udf, to change it's appearance like a button. Link to comment Share on other sites More sharing options...
Tvern Posted April 19, 2008 Share Posted April 19, 2008 (edited) is there a way to put an image in your gui as a button? I was just trying to do the same thing. Make a 100x100 pixel image call a function when clicked. $Button = GUICtrlCreateButton ("", 10,-1,100,100,$BS_BITMAP) GUICtrlSetImage(-1,"Path\image.bmp")oÝ÷ ØƤzƺÛh©â¨¢{h¦âµ»×åÉÊ'µ¨§nj_W¬jëh×6$Button = GUICtrlCreateButton ("", 10,-1,100,100,$BS_ICON) GUICtrlSetImage(-1,"Path\icon.ico") Does the same, but only accepts *.ico and libraries containing them. I am still trying to find a way to make clicking a jpg call a function, but it might not be possible. Edit: But then the $SS_NOTIFY seems pretty much exactly what I need. I make stuff way to complicated some times. Adding a different cursor style on mouseover will make it more intuitive in use aswell. Edited April 19, 2008 by Tvern Link to comment Share on other sites More sharing options...
Valuater Posted April 19, 2008 Share Posted April 19, 2008 ButtonHover() UDFhttp://www.autoitscript.com/forum/index.ph...st&p=288428Level 2EzSkin with buttons and skinhttp://www.autoitscript.com/forum/index.ph...st&p=3073808) Link to comment Share on other sites More sharing options...
James Posted April 19, 2008 Share Posted April 19, 2008 #include <GUIConstants.au3> GUICreate("Image button", 95, 55) $Button = GUICtrlCreateButton("", 10, 10, 75, 35, $BS_ICON) GUICtrlSetImage(-1, "shell32.dll", 10) GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $Button MsgBox(0, "", "You clicked the icon button!") EndSwitch WEnd Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
Valuater Posted April 19, 2008 Share Posted April 19, 2008 #include <GUIConstants.au3> GUICreate("Image button", 95, 55) $Button = GUICtrlCreateButton("", 10, 10, 75, 35, $BS_ICON) GUICtrlSetImage(-1, "shell32.dll", 10) GUISetState() While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE Exit Case $Button MsgBox(0, "", "You clicked the icon button!") EndSwitch WEnd Maybe, you can try reading this again ... $Button = GUICtrlCreateButton ("", 10,-1,100,100,$BS_ICON) GUICtrlSetImage(-1,"Path\icon.ico") Does the same, but only accepts *.ico and libraries containing them. I am still trying to find a way to make clicking a jpg call a function, but it might not be possible. 8 Link to comment Share on other sites More sharing options...
James Posted April 19, 2008 Share Posted April 19, 2008 Woops, sorry guys! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
NELyon Posted April 19, 2008 Share Posted April 19, 2008 #include <StaticConstants.au3> #include <GUIConstantsEx.au3> $hGUI = GUICreate("Test", 300, 300) $pic = GUICtrlCreatePic("Path.To.jpg", 0, 0, -1, -1, $SS_NOTIFY) GUISetState() While 1 Switch GUIGetMsg() Case -3 Exit Case $pic MsgBox(0, "Hmm", "MMkay?") EndSwitch WEnd Link to comment Share on other sites More sharing options...
ludocus Posted April 22, 2008 Author Share Posted April 22, 2008 thnx everybody 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