timeone Posted February 4, 2013 Share Posted February 4, 2013 (edited) GUICtrlSetStyle kullanarak gui'de ki öğelere stil ekleyebiliyoruz. Peki eklediğimiz stili nasıl kaldırabiliriz arkadaşlar, bir türlü bulamadım. Yardımlarınız için teşekkürler. Edited February 4, 2013 by timeone Quote Link to comment Share on other sites More sharing options...
timeone Posted February 4, 2013 Author Share Posted February 4, 2013 bilen yok mu arkadaşlar, en azından kaldırılmıyor vs. diye cevap verin, kimse okumuyor Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted February 4, 2013 Share Posted February 4, 2013 Eklediğin stili nasıl mı kaldırabilirsin ? E stil satırını sil o kendiliğinden kalkar zaten :D yada sen yanlış ifade ettin olayı. Quote Link to comment Share on other sites More sharing options...
timeone Posted February 5, 2013 Author Share Posted February 5, 2013 GUICtrlSetStyle(-1, $BS_3STATE) ile checkboxu tıkladığımız da etki etmeyecek hale getiriyorum. GUICtrlSetStyle(-1, 0), GUICtrlSetStyle(-1, Default), GUICtrlSetStyle(-1, "") denedim fakat işe yaramıyor. Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted February 5, 2013 Share Posted February 5, 2013 Tamam da senin ne yapmak isteğin belli değil ki. Şimdi eğer bir işlem yapıyorsan yani farzı misal şu dosya şurada ise checkboxu etkisiz hala getir eğer değilse checkboxu normale çevir şeklinde kodlama yaparsan isteğini yapabilirsin.Hem bu stil kodlarına çok takılma gui controllerini disable veya enable de yapabilirsin ki genelde biz öyle kullanırız.Yapmak isteğin şeyi veya proje dosyan varsa paylaşırsan daha iyi yardımcı olabileceğimizi düşünüyorum :) Quote Link to comment Share on other sites More sharing options...
timeone Posted February 5, 2013 Author Share Posted February 5, 2013 disable enableyi biliyorum ama ben böyle yapmak istiyorum. Quote Link to comment Share on other sites More sharing options...
SimpsoN_Bart Posted February 5, 2013 Share Posted February 5, 2013 Yapmak isteğin şeyi hala tam olarak anlamış değilim ve kod bile vermedim bize neyse. Stil kodları için biraz kütüphane incele belki aradığın şeyi ButtonConstants.au3 kütüphane dosyasında bulursun.Gerçi hatırladığım kadarıyla Checkbox ile ilgili pek stil kodu yoktu. Quote Link to comment Share on other sites More sharing options...
blue_life Posted February 5, 2013 Share Posted February 5, 2013 Başlangıçta GUICtrlGetState komutu ile ilgil gui elemanın varsayılan style değerini bir değişkene atayabilirsiniz. Daha sonra GUICtrlSetStyle komutu ile bu atadığınız değişkeni kullanarak gui elemanının style değerini resetlemeniz mümkün... Quote Link to comment Share on other sites More sharing options...
blackman12 Posted February 5, 2013 Share Posted February 5, 2013 Kullandığın hangi nesneyse ona help dosyasında bak orada default olarak hangi style da olduğunu yazıyor. oradaki style ı uygulayarak varsayılan hale getirebilirsin. Quote Link to comment Share on other sites More sharing options...
timeone Posted February 5, 2013 Author Share Posted February 5, 2013 yardımlarınız için teşekkürler :) @blackman12, her stil için default kodu yok maalesef. @blue_life, ilk halinin stilini nasıl çekeceğiz? guictrlgetstyle gibi bir fonksiyon yok, ne kullanmalıyım? ayrıca burada: http://www.autoitscript.com/forum/topic/91405-how-to-remove-a-style/ bazı örnekler vermişler, kodları kopyalayıp denedim çalışıyor fakat ben bunu checkboxa nasıl uygulayacağım bilmiyorum... Quote Link to comment Share on other sites More sharing options...
mesale0077 Posted February 5, 2013 Share Posted February 5, 2013 kardeş ne yapmak istiyorsan kod örnegini koyarsan sana yardımcı olabiliriz ama ben sana kod örneği veriyorum bir daha kod örneği olmazsa yardımcı olmayacağım #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("[#] Form1 [#]", 402, 263, 192, 124) $Group1 = GUICtrlCreateGroup("Group1", 16, 24, 169, 209) $Checkbox1 = GUICtrlCreateCheckbox("Checkbox1", 40, 56, 97, 17) $Button1 = GUICtrlCreateButton("Button1", 24, 168, 57, 33) $Button2 = GUICtrlCreateButton("Button2", 104, 168, 65, 33) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Group2", 200, 24, 177, 209) $Button3 = GUICtrlCreateButton("Button3", 208, 168, 65, 33) $Button4 = GUICtrlCreateButton("Button4", 296, 168, 73, 33) $Checkbox2 = GUICtrlCreateCheckbox("Checkbox2", 224, 64, 97, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 GUICtrlSetState($Checkbox1, $GUI_CHECKED) Case $Button2 GUICtrlSetState($Checkbox1,$GUI_UNCHECKED) Case $Button3 GUICtrlSetState($Checkbox2, $GUI_CHECKED) GUICtrlSetState($Checkbox2, 128) Case $Button4 GUICtrlSetState($Checkbox2, $GUI_UNCHECKED) GUICtrlSetState($Checkbox2, 64) EndSwitch WEnd Quote Link to comment Share on other sites More sharing options...
timeone Posted February 5, 2013 Author Share Posted February 5, 2013 guictrlsetstate fonksiyonunu kullanmak istemiyorum. guictrsetstyle ile yaptığım değişikliği geri almak istiyorum. checkboxu $BS_3STATE stiline getirip geri almak istiyorum. ama neyse arkadaşlar, olmuyor ya da ben yapamıyorum. desteğiniz için teşekkürler, artık son çare devre dışı bırakmayı kullanacağım. Quote Link to comment Share on other sites More sharing options...
mesale0077 Posted February 5, 2013 Share Posted February 5, 2013 (edited) kardeş basit bir kodu koy ben bir bakayım tam ne yapmak istediğini onu anlayamadık #include <GUIConstantsEx.au3> #include <GuiButton.au3> #include <WindowsConstants.au3> Global $iMemo _Main() Func _Main() Local $rdo, $rdo2, $chk GUICreate("Buttons", 400, 400) $iMemo = GUICtrlCreateEdit("", 119, 10, 276, 374, $WS_VSCROLL) GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New") $rdo = GUICtrlCreateRadio("Radio1", 10, 10, 90, 50) $rdo2 = GUICtrlCreateRadio("Radio2", 10, 60, 90, 50) _GUICtrlButton_SetCheck($rdo2) _GUICtrlButton_SetFocus($rdo2) ; set focus, shows this doesn't affect _GUICtrlButton_GetCheck $chk = GUICtrlCreateCheckbox("Check1", 10, 120, 90, 50, BitOR($BS_AUTO3STATE, $BS_NOTIFY)) _GUICtrlButton_SetCheck($chk, $BST_INDETERMINATE) GUISetState() MemoWrite("$rdo checked status.: " & @CRLF & @TAB & _ExplainCheckState(_GUICtrlButton_GetCheck($rdo)) & @CRLF) MemoWrite("$rdo2 checked status: " & @CRLF & @TAB & _ExplainCheckState(_GUICtrlButton_GetCheck($rdo2)) & @CRLF) MemoWrite("$chk checked status.: " & @CRLF & @TAB & _ExplainCheckState(_GUICtrlButton_GetCheck($chk)) & @CRLF) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Exit EndFunc ;==>_Main ; Write a line to the memo control Func MemoWrite($sMessage) GUICtrlSetData($iMemo, $sMessage & @CRLF, 1) EndFunc ;==>MemoWrite Func _ExplainCheckState($iState) Switch $iState Case $BST_CHECKED Return "Button is checked." Case $BST_INDETERMINATE Return "Button is grayed, indicating an indeterminate state (applies only if the button has the $BS_3STATE or $BS_AUTO3STATE style)." Case $BST_UNCHECKED Return "Button is cleared" EndSwitch EndFunc ;==>_ExplainCheckState birde buna bak demek istediğin bumu acaba Edited February 5, 2013 by mesale0077 Quote Link to comment Share on other sites More sharing options...
timeone Posted February 5, 2013 Author Share Posted February 5, 2013 (edited) #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> GUI() Func GUI() Local $checkbox GUICreate("GUI", 200, 100) $checkbox = GUICtrlCreateCheckbox("CHECKBOX 1", 10, 10, 120, 20) $Button_1 = GUICtrlCreateButton("CheckBox'u salt okunur hale getir", 10, 40, 170) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 GUICtrlSetStyle($checkbox, $BS_3STATE) GUICtrlDelete($Button_1) EndSelect WEnd EndFunc Edited February 5, 2013 by timeone Quote Link to comment Share on other sites More sharing options...
mesale0077 Posted February 5, 2013 Share Posted February 5, 2013 #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> GUI() Func GUI() Local $checkbox GUICreate("GUI", 200, 100) $checkbox = GUICtrlCreateCheckbox("CHECKBOX 1", 10, 10, 120, 20) $Button_1 = GUICtrlCreateButton("CheckBox'u salt okunur hale getir", 10, 40, 170) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 GUICtrlSetStyle($checkbox, $BS_3STATE) GUICtrlDelete($Button_1) GUICtrlSetStyle($checkbox,$BS_NOTIFY) GUICtrlSetData($checkbox,"checkbox devre dışı") EndSelect WEnd EndFunc Quote Link to comment Share on other sites More sharing options...
timeone Posted February 5, 2013 Author Share Posted February 5, 2013 ben checkboxu yoketmek istemiyorum. GUICtrlSetStyle($checkbox, $BS_3STATE) ile ne kadar tıklasan da etki etmeyecek hale getirdim, tekrardan değiştirilebilir hale getirmek istiyorum. Bir türlü anlatamadım derdimi :( Quote Link to comment Share on other sites More sharing options...
mesale0077 Posted February 5, 2013 Share Posted February 5, 2013 #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> GUI() Func GUI() Local $checkbox GUICreate("GUI", 200, 100) $checkbox = GUICtrlCreateCheckbox("CHECKBOX 1", 10, 10, 120, 20) $Button_1 = GUICtrlCreateButton("CheckBox'u salt okunur hale getir", 10, 40, 170) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 GUICtrlSetStyle($checkbox, $BS_3STATE) GUICtrlDelete($Button_1) GUICtrlSetStyle($checkbox,$BS_AUTO3STATE) EndSelect WEnd EndFunc Quote Link to comment Share on other sites More sharing options...
timeone Posted February 5, 2013 Author Share Posted February 5, 2013 Bu seferde çok değişik bir hale geldi. Bir dolu kutu oluyor bir tik geliyor. Arkadaşlar daha fazla yormak istemiyorum sizi olmuyor demek ki. Quote Link to comment Share on other sites More sharing options...
mesale0077 Posted February 5, 2013 Share Posted February 5, 2013 (edited) #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> GUI() Func GUI() Local $checkbox GUICreate("GUI", 200, 100) $checkbox = GUICtrlCreateCheckbox("CHECKBOX 1", 10, 10, 120, 20) $Button_1 = GUICtrlCreateButton("CheckBox'u salt okunur hale getir", 10, 40, 170) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 GUICtrlSetStyle($checkbox, 0x0005) GUICtrlDelete($Button_1) GUICtrlSetStyle($checkbox,0x0003) GUICtrlSetData($checkbox,"etkin") EndSelect WEnd EndFunc sorun çözülmüş arkadaşım :) bir daha sefere kodunu ver ona göre çözülecektir :) Edited February 6, 2013 by mesale0077 Quote Link to comment Share on other sites More sharing options...
blackman12 Posted February 6, 2013 Share Posted February 6, 2013 Sana cevabın Help dosyasında olduğunu söylemiştim: #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> GUI() Func GUI() Local $checkbox, $checkbox_def_style, $buton_def_text = "CheckBox'u salt okunur hale getir", $buton_text = "CheckBox'ı varsayılan hale getir" GUICreate("GUI", 200, 100) $checkbox = GUICtrlCreateCheckbox("CHECKBOX 1", 10, 10, 120, 20) $Button_1 = GUICtrlCreateButton($buton_def_text, 10, 40, 170) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 if GUICtrlRead($Button_1) = $buton_def_text Then GUICtrlSetStyle($checkbox, $BS_3STATE) GUICtrlSetData($Button_1,$buton_text) Else GUICtrlSetStyle($checkbox, $BS_AUTOCHECKBOX) GUICtrlSetData($Button_1,$buton_def_text) EndIf EndSelect WEnd EndFunc GUICtrlCreateCheckbox'a bakarsan style bölümünde bunları görebilirsin: default ( -1) : $BS_AUTOCHECKBOX. forced styles : $WS_TABSTOP, and $BS_AUTOCHECKBOX if no checkbox style defined. 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.