furrycow Posted February 9, 2009 Posted February 9, 2009 (edited) Hey, I am trying to create a button that has an image of an icon on it...this works perfectly fine when using an icon in a .dll file, already in Windows, however, when i try and use a .ico file, it does not work...in the help example it doesnt show it with .ico's and was wondering if it was possible? Just the basic code ive got for this button so far (that isnt working) is: $BUTStart = GUICtrlCreateButton("Start", 8, 8, 50, 40, $BS_ICON) ;_GUICtrlButton_SetImage($BUTStart,"C:\Play.ico") ; I have tried it with this method too GUICtrlSetImage($BUTStart,"C:\Play.ico") Thanks. Edited February 9, 2009 by furrycow Instant Lockerz Invite - www.instantlockerzinvite.co.uk
Authenticity Posted February 9, 2009 Posted February 9, 2009 Perhaps, the Play.ico file is not a native icon file... It works fine over here with one of Microsoft's icon files.
furrycow Posted February 9, 2009 Author Posted February 9, 2009 Perhaps, the Play.ico file is not a native icon file... It works fine over here with one of Microsoft's icon files.Actually yeah, just tried the same thing and it works . Should have tried that before! Cheers buddy. Instant Lockerz Invite - www.instantlockerzinvite.co.uk
KaFu Posted February 9, 2009 Posted February 9, 2009 I guess too it has something to do with the .ico file:#include <GUIConstantsEx.au3> #include <ButtonConstants.au3> Local $msg GUICreate("My GUI"); will create a dialog box that when displayed is centered GUICtrlCreateButton("my picture button", 10, 20, 40, 40, $BS_ICON) GUICtrlSetImage(-1, StringLeft(@AutoItExe, StringLen(@AutoItExe) - 11) & '\icons\au3.ico') GUISetState() ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEndRelated to any Icon editing I strongly recommend the freeware app '@icon sushi':http://www.towofu.net/soft/e-aicon.php OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2025-May-18) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
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