Jump to content

Autoit Stil Nasıl Kaldırılır ?


timeone
 Share

Recommended Posts

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 by timeone
Link to comment
Share on other sites

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 :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by mesale0077
Link to comment
Share on other sites

#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 by timeone
Link to comment
Share on other sites

#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
Link to comment
Share on other sites

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 :(
Link to comment
Share on other sites

#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
Link to comment
Share on other sites

#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 by mesale0077
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...