Mehmet Posted November 16, 2011 Share Posted November 16, 2011 (edited) [b]böyleyken sorun yok[/b] [codebox] #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 154, 124) $Button1 = GUICtrlCreateButton("", 40, 24, 65, 57, $BS_ICON) GUICtrlSetImage(-1, "C:\Documents and Settings\UXP\Desktop\speaker.ico", -1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd [/codebox] [b]ama fileinstall ile tempden çekince olmuyor nerde hatam var forumda aradım ams ile ilgili çıkıyor bir türlü bulamadım[/b] [codebox] #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 154, 124) DirCreate(@TempDir & "\Deneme") FileInstall("speaker.ico",@TempDir & "\Deneme\speaker.ico",1) $Button1 = GUICtrlCreateButton("", 40, 24, 65, 57, $BS_ICON) GUICtrlSetImage(@TempDir & "\Deneme\speaker.ico", -1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE DirRemove(@TempDir & "\Deneme" ,1) Exit EndSwitch WEnd [/codebox] Edited November 16, 2011 by MeHMeTBeN Quote Link to comment Share on other sites More sharing options...
blue_life Posted November 16, 2011 Share Posted November 16, 2011 @MeHMeTBeN [b]GUICtrlSetImage [/b]komutunu hatalı kullanmışsın! [color="#0000FF"][b]GUICtrlSetImage(-1,@TempDir & "\Deneme\speaker.ico")[/b][/color] -1 rakamı en son oluşturulan GUICtrl... elamının bir nevi kimliğini ifaede etmektedir! Quote Link to comment Share on other sites More sharing options...
Mehmet Posted November 16, 2011 Author Share Posted November 16, 2011 icon ismini değiştirip ikinci bir butona atadığımdada aynı uzantıyı alıyor $Button2 = GUICtrlCreateButton("", 264, 72, 105, 81, $BS_ICON) GUICtrlSetImage(-1, "C:\Documents and Settings\UXP\Desktop\cspeaker.ico", -1) birde o kısmı sürekli değiştirmekmi gerekiyor yoksa kodada bir ayarı varmı onun Quote Link to comment Share on other sites More sharing options...
blue_life Posted November 17, 2011 Share Posted November 17, 2011 @MeHMeTBeN Ne demek istediğini tam anlayamadım malesef GUICtrlSetImage hakkında yardım dosyasına gözat. Son kısımdaki -1 ne oluyor! Senin verdiğin ikinci örnekte; ([b]GUICtrlSetImage(@TempDir & "\Deneme\speaker.ico", -1)[/b]) ilk önce icon doysasını yazmışsın. Ilk önce gui elemanının idini yazmalıydın... GUICtrlSetImage(@TempDir & "\Deneme\speaker.ico", -1)[b][color="#FF0000"] -->[/color][/b] GUICtrlSetImage(-1,@TempDir & "\Deneme\speaker.ico") olacaktı. Yada -1 yerine $Button1 da yazabilirsin. Yani GUICtrlSetImage($Button1,@TempDir & "\Deneme\speaker.ico",0) Daha önce yazdığım üzer GUICtrlSetImage hakkında yardım dosyasına gözatmalısın! Quote Link to comment Share on other sites More sharing options...
radyofon Posted November 17, 2011 Share Posted November 17, 2011 Üstadımın dediği gibi controlid olarak -1 yerine değişkenin kendisini yazabilirsin. [code] #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 154, 124) DirCreate(@TempDir & "\Deneme") FileInstall("speaker.ico",@TempDir & "\Deneme\speaker.ico",1) $Button1 = GUICtrlCreateButton("", 40, 24, 65, 57, $BS_ICON) GUICtrlSetImage($Button1, @TempDir & "\Deneme\speaker.ico") $Button2 = GUICtrlCreateButton("", 264, 72, 105, 81, $BS_ICON) GUICtrlSetImage($Button2, "C:\Documents and Settings\UXP\Desktop\cspeaker.ico") GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE DirRemove(@TempDir & "\Deneme" ,1) Exit EndSwitch WEnd [/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.