Clark Posted March 1, 2013 Share Posted March 1, 2013 $ActGroup2 = GUICtrlCreateGroup("Actions", 50, 360, 520, 50) $btnRefresh=GUICtrlCreateButton("Refresh",70,375,80,25) GUICtrlSetImage(-1,"shell32.dll",221,0) GUICtrlSetTip(-1,"Reset filter and refresh") $btnExport=GUICtrlCreateButton("Export",170,375,80,25,$BS_ICON) GUICtrlSetImage(-1,"C:\Program Files (x86)\Microsoft Office\Office14\EXCEL.EXE",1,0) GUICtrlSetTip(-1,"Export to Excel") $btnNew=GUICtrlCreateButton("New",270,375,80,25,$BS_ICON) GUICtrlSetImage(-1,"shell32.dll",1,0) GUICtrlSetTip(-1,"Create new RFC") $btnExit = GUICtrlCreateButton("Exit", 370, 375, 80, 25) GUICtrlSetImage(-1,"shell32.dll",329,0) $btnOpen = GUICtrlCreateButton("Open", 470, 375, 80, 25) GUICtrlSetImage(-1,"shell32.dll",290,0) GUICtrlCreateGroup("", -99, -99, 1, 1)Hi allIn the following screen snap, you will notice that the second and third buttons do not have text, and yet in the code they clearly do.Does anyone know why this is so? Link to comment Share on other sites More sharing options...
Nessie Posted March 1, 2013 Share Posted March 1, 2013 (edited) Try to remove ,$BS_ICON from the buttons Hi! Edited March 1, 2013 by Nessie My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s). My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all! My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file Link to comment Share on other sites More sharing options...
Clark Posted March 1, 2013 Author Share Posted March 1, 2013 (edited) Thanks, that works. I thought the $BS_ICON was required in order to show the icon. edit: Which doesn't make a lot of sense as the ones that worked didn't have it. Edited March 1, 2013 by Clark Link to comment Share on other sites More sharing options...
Nessie Posted March 1, 2013 Share Posted March 1, 2013 (edited) All's well that ends well Edited March 1, 2013 by Nessie My UDF: NetInfo UDF Play with your network, check your download/upload speed and much more! YTAPI Easy to use YouTube API, now you can easy retrive all needed info from a video. NavInfo Check if a specific browser is installed and retrive other usefull information. YWeather Easy to use Yahoo Weather API, now you can easily retrive details about the weather in a specific region. No-IP UDF Easily update your no-ip hostname(s). My Script: Wallpaper Changer Change you wallpaper dinamically, you can also download your wallpaper from your website and share it with all! My Snippet: _ImageSaveToBMPConvert an image to bmp format. _SciteGOTO Open a file in SciTE at specific fileline. _FileToHex Show the hex code of a specified file Link to comment Share on other sites More sharing options...
AZJIO Posted March 1, 2013 Share Posted March 1, 2013 (edited) expandcollapse popup#include <GUIConstantsEx.au3> #include <GuiButton.au3> #include <GuiImageList.au3> $hGui = GUICreate('My Program', 650, 460) $ActGroup2 = GUICtrlCreateGroup("Actions", 50, 360, 520, 50) $btnRefresh = GUICtrlCreateButton("Refresh", 70, 375, 80, 25) _GUICtrlSetImage($btnRefresh, "shell32.dll", 221) GUICtrlSetTip(-1, "Reset filter and refresh") $btnExport = GUICtrlCreateButton("Export", 170, 375, 80, 25, $BS_ICON) _GUICtrlSetImage($btnExport, "C:\Program Files\Microsoft Office\Office14\EXCEL.EXE", 1, 0) GUICtrlSetTip(-1, "Export to Excel") $btnNew = GUICtrlCreateButton("New", 270, 375, 80, 25, $BS_ICON) _GUICtrlSetImage($btnNew, "shell32.dll", 1, 0) GUICtrlSetTip(-1, "Create new RFC") $btnExit = GUICtrlCreateButton("Exit", 370, 375, 80, 25) _GUICtrlSetImage($btnExit, "shell32.dll", 329, 0) $btnOpen = GUICtrlCreateButton("Open", 470, 375, 80, 25) _GUICtrlSetImage($btnOpen, "shell32.dll", 290, 0) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE Func _GUICtrlSetImage($hButton, $sFileIco, $iIndIco = 0, $iSize = 0) Switch $iSize Case 0 $iSize = 16 Case 1 $iSize = 32 Case Else $iSize = 16 EndSwitch Local $hImage = _GUIImageList_Create($iSize, $iSize, 5, 3, 6) _GUIImageList_AddIcon($hImage, $sFileIco, $iIndIco) _GUICtrlButton_SetImageList($hButton, $hImage) Return $hImage EndFunc ;==>_GUICtrlSetImage Edited March 1, 2013 by AZJIO FastJMAN1 1 My other projects or all Link to comment Share on other sites More sharing options...
Clark Posted March 5, 2013 Author Share Posted March 5, 2013 Thanks Azjio, but I'm not understanding why your method above is better. Can you enlighten me? Link to comment Share on other sites More sharing options...
AZJIO Posted March 5, 2013 Share Posted March 5, 2013 Clark Works on WinXP My other projects or all 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