Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > AutoIt
You last visited: Today at 11:26

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Problem wenn Buttons Disable dann Enable sind die buttons zum senden zu verwenden

Discussion on Problem wenn Buttons Disable dann Enable sind die buttons zum senden zu verwenden within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
pzyhô's Avatar
 
elite*gold: 42
Join Date: Oct 2009
Posts: 391
Received Thanks: 398
Problem wenn Buttons Disable dann Enable sind die buttons zum senden zu verwenden

also hab ja durch hilfe geschafft buttons mit Checkbox Enable und disable zu machn nur mein prob ist jetzt das ich die buttons nicht verwenden kann hab schon einiges ausprobiert aber wenn ich dann bsp button1 drücke passiert einfach nix kann mir wer helfen `? bekommt thx für

hier der code:
Code:
#include <GUIConstantsEx.au3>
GUICreate("")
$check = GUICtrlCreateCheckbox("Enable/Disable Buttons", 10, 10, 140, 20)
$button = GUICtrlCreateButton("Button",10,50)
$button1 = GUICtrlCreateButton("Button1",10,90)
GUICtrlSetState($button,$GUI_DISABLE)
GUICtrlSetState($button1,$GUI_DISABLE)
GUISetState()



While 1
	$msg = GUIGetMsg()
	$read = GUICtrlRead($check)
	If $msg = $GUI_EVENT_CLOSE Then ExitLoop
	If $msg = $check And $read = $GUI_CHECKED Then
		GUICtrlSetState($button,$GUI_ENABLE)
		GUICtrlSetState($button1,$GUI_ENABLE)
	ElseIf $msg = $check And $read = $GUI_UNCHECKED Then
		GUICtrlSetState($button,$GUI_DISABLE)
		GUICtrlSetState($button1,$GUI_DISABLE)
	EndIf
WEnd
pzyhô is offline  
Old 11/13/2009, 16:25   #2
 
| Moep |'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,079
Received Thanks: 438
In deinem Script steht ja auch an keiner Stelle was bei Button 1 passieren soll...
Mich würd ja mal interresieren was du schon alles probiert hast

Nochmal bekommst du nämlich kein fertiges Script von mir, welches du einfach nur kopieren brauchst. Denn scheinbar hast du nicht verstanden wie es funktioniert.
Beschäftige dich intensiver mit den Basics und lern deine Probleme selber zu lösen. Denn anstatt dir die Lösung in der AUtoit Hilfe selber zu suchen, eröffnest du bei jedem kleinen Problem nen neuen Tread.
| Moep | is offline  
Thanks
1 User
Old 11/13/2009, 17:12   #3
 
pzyhô's Avatar
 
elite*gold: 42
Join Date: Oct 2009
Posts: 391
Received Thanks: 398
also ich hab das hier schon versucht!...

Code:
#include <GUIConstantsEx.au3>
GUICreate("")
$check = GUICtrlCreateCheckbox("Enable/Disable Buttons", 10, 10, 140, 20)
$button = GUICtrlCreateButton("Button",10,50)
$button1 = GUICtrlCreateButton("Button1",10,90)
GUICtrlSetState($button,$GUI_DISABLE)
GUICtrlSetState($button1,$GUI_DISABLE)
GUISetState()



While 1
	$msg = GUIGetMsg()
	$read = GUICtrlRead($check)
	If $msg = $GUI_EVENT_CLOSE Then ExitLoop
	If $msg = $check And $read = $GUI_CHECKED Then
		GUICtrlSetState($button,$GUI_ENABLE)
		GUICtrlSetState($button1,$GUI_ENABLE)
	ElseIf $msg = $check And $read = $GUI_UNCHECKED Then
		GUICtrlSetState($button,$GUI_DISABLE)
		GUICtrlSetState($button1,$GUI_DISABLE)
	EndIf
WEnd

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

		Case $Button1
			Sleep(500)
                send("test")
Endswitch
WEnd
dann auch das hier:

Code:
#include <GUIConstantsEx.au3>
GUICreate("")
$check = GUICtrlCreateCheckbox("Enable/Disable Buttons", 10, 10, 140, 20)
$button = GUICtrlCreateButton("Button",10,50)
$button1 = GUICtrlCreateButton("Button1",10,90)
GUICtrlSetState($button,$GUI_DISABLE)
GUICtrlSetState($button1,$GUI_DISABLE)
GUISetState()



While 1
	$msg = GUIGetMsg()
	$read = GUICtrlRead($check)
	If $msg = $GUI_EVENT_CLOSE Then ExitLoop
	If $msg = $check And $read = $GUI_CHECKED Then
		GUICtrlSetState($button,$GUI_ENABLE)
		GUICtrlSetState($button1,$GUI_ENABLE)
	ElseIf $msg = $check And $read = $GUI_UNCHECKED Then
		GUICtrlSetState($button,$GUI_DISABLE)
		GUICtrlSetState($button1,$GUI_DISABLE)
	EndIf
        Case $Button1
        Send("TEST")
WEnd
also kannste nicht sagen ich hätts nciht versucht ^^ komme nur nicht drauf welchen befehl ich brauch
da es nicht funktionieren will
pzyhô is offline  
Old 11/13/2009, 18:45   #4
 
| Moep |'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,079
Received Thanks: 438
Siehste, genau das mein ich mit Basics.
Im ersten hast zu zwei while schleifen. Da die Abbruchbedingungen der ersten immer wahr ist kommt dein script NIE in die zweite while schleife.
Im zweiten script hast du einfach irgendwo nen case rein geschmissen ohne den syntax zu beachten.
| Moep | is offline  
Thanks
1 User
Old 11/15/2009, 12:50   #5
 
pzyhô's Avatar
 
elite*gold: 42
Join Date: Oct 2009
Posts: 391
Received Thanks: 398
@MOEP habs rausgefunden durch langes testen und mehr damit zu befassen ^^ hatte die art wie das funzzt noch garnicht beachtet das das eine möglichkeit ist hier is der code der jetzt auch so funktioniert wie ich möchte :

Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 158, 116, 203, 125)
$Checkbox1 = GUICtrlCreateCheckbox("Activate Buttons", 8, 8, 97, 17)
$Button1 = GUICtrlCreateButton("Start", 40, 32, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Stop", 40, 64, 75, 25, $WS_GROUP)
GUICtrlSetState($Button1, $GUI_DISABLE)
GUICTrlSetState($Button2, $GUI_DISABLE)
GUISetState()
#EndRegion ### END Koda GUI section ###

While 1
	$msg = GuiGetmsg()
	$read = GuiCtrlRead($checkbox1)
	If $msg = $GUI_EVENT_CLOSE then exit
	If $msg = $Checkbox1 and $read = $GUI_Checked Then
		GUICtrlSetState($Button1, $GUI_ENABLE)
		GUICTrlSetState($Button2, $GUI_ENABLE)
		EndiF
		If $msg = $Button1 Then
			Sleep(5000)
			Send("Testsatz")
			EndiF
WEnd
weis jetzt nicht ob das ein umständlicher weg ist aber ich find das so eigentlich recht einfach gemacht
pzyhô is offline  
Old 11/19/2009, 15:47   #6
 
elite*gold: 0
Join Date: Nov 2009
Posts: 135
Received Thanks: 42
#edit sorry hast es ja geschafft
x|Zero|x is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
Problem mit Buttons
04/06/2010 - AutoIt - 3 Replies
Hallo, ich habe ein Problem mit den Buttons ich will das eine BMP Datei als Button angezeigt wird , diese wird zuerst in den Temp-Ordner kopiert . Hier mein code: $Button1 = GUICtrlCreateButton("", 16, 40, 75, 25, 0,$BS_BITMAP) GUICtrlSetImage (-1,@Tempdir & "\Button1.bmp") Aber es funktioniert nicht ,weis jemand warum?
[PROBLEM] Buttons nicht anklickbar!?
02/23/2010 - AutoIt - 7 Replies
Hey Leute hab mal wieder ne GUI erstellt mit Koda und da merk ich das ich die Buttons nicht anklicken kann! Hab schon alles mögliche Versucht, mir wurde gesagt das es iwi an den Schichten liegen könnte aber die Buttons liegen ganz oben sonst könnte man sie ja nicht sehen ;) Hoffe jemand weis da was, Gruß, Eddy² P.S: Nicht nur die Buttons sind nicht anklickbar, sondern überhaupt alles! €dit: Hat sich erledigt! Es lag an dem Hintergrundbild oO Hab einfach in dem Bereich wo die Buttons...
Problem mehrere Buttons auswählen
11/18/2009 - AutoIt - 5 Replies
Hi, ich wollte mir mal selber einen bot machen womit ich mehrere Sachen durch Buttonklick starten kann. Soweit ist alles ok aber ein Problem gibts trotzdem: Wenn ich einen Button anklicke wird das auch ausgeführt aber sobalt ich einen 2. dazu haben will funktioniert nur der 1. weiter. Das ist bei jedem Button so den ich dazu starten will. Kann mir jemand da mal weiterhelfen? Hier der Script: #include <GUIConstants.au3> #include <ButtonConstants.au3> #include <WindowsConstants.au3> ...
[Buttons]Hi wer kann mir die Buttons erklären
08/16/2009 - Metin2 Private Server - 6 Replies
Hi ich will kg machen,kenne aber die bedeutung der buttons nich könnt ihr mir vllt.helfen MfG TheRisk Hier ein Screen:http://img16.imageshack.us/img16/3016/gaul. jpg



All times are GMT +2. The time now is 11:26.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.