|
You last visited: Today at 21:08
Advertisement
Autoit Problem *Anfänger*
Discussion on Autoit Problem *Anfänger* within the AutoIt forum part of the Coders Den category.
07/25/2009, 16:54
|
#1
|
elite*gold: 0
Join Date: Dec 2008
Posts: 367
Received Thanks: 217
|
Autoit Problem *Anfänger*
Hi Leute, ich habe ein problem ^^
Ich möchte eine Einfache Form erstellen mit einem Button .
So weit so gut..habs halt mit Koda gemacht und so sieht es bis jetz aus
Quote:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\Yannik\Desktop\Form10.kxf
$Form1 = GUICreate("Close", 231, 215, 188, 140)
GUISetIcon("C:\Users\Yannik\Desktop\oO.ico")
$Button1 = GUICtrlCreateButton("Herunterfahren", 0, 8, 225, 201, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
|
Schön schön, nur ich möchte jetz, dass wenn ich auf den Button Klicke er den Pc herunterfährt [shutdown(0)]
Ich habe es so ausprobiert
Quote:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\Yannik\Desktop\Form10.kxf
$Form1 = GUICreate("Close", 231, 215, 188, 140)
GUISetIcon("C:\Users\Yannik\Desktop\oO.ico")
$Button1 = GUICtrlCreateButton("Herunterfahren", 0, 8, 225, 201, $WS_GROUP)
GUISetState(@SW_SHOW)
if $Button1 Then
Shutdown(0)
EndIf
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
|
Mir fiel nichts anderen ein als
Quote:
if $Button1 Then
Shutdown(0)
EndIf
|
das soll halt heissen falls man den button 1 klickt, soll er herunterfahren .
Also als ich es getestet habe(F5) ist der pc direkt heruntergefahren..  
könnte mir jemand den code sagen, dass wenn ich auf den button klicke er herunter fährt? Wäre super
lg euer Autoit anfänger xP
|
|
|
07/25/2009, 16:58
|
#2
|
elite*gold: 20
Join Date: Mar 2007
Posts: 840
Received Thanks: 452
|
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Users\Yannik\Desktop\Form10.kxf
$Form1 = GUICreate("Close", 231, 215, 188, 140)
GUISetIcon("C:\Users\Yannik\Desktop\oO.ico")
$Button1 = GUICtrlCreateButton("Herunterfahren", 0, 8, 225, 201, $WS_GROUP)
GUISetState(@SW_SHOW)
if $Button1 Then
Shutdown(0)
EndIf
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
;hier die änderung
Case Button1
Shutdown(0)
EndSwitch
WEnd
Bitte lerne den Umgang mit der Tabulator Taste
|
|
|
07/25/2009, 19:40
|
#3
|
elite*gold: 0
Join Date: Dec 2008
Posts: 367
Received Thanks: 217
|
Danke dir, so ein neues Problem, will das wenn man button 1 drückt er aus der Inputbox1 den text entnimmt und ihn in einer msgbox wieder gibt.
Bei mir zeigt er aber immer "6" an, anstatt den Inhalt der Inputbox oO
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 445, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 64, 176, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Button2", 296, 96, 75, 25, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Button3", 408, 240, 75, 25, $WS_GROUP)
$Input1 = GUICtrlCreateInput("Input1", 56, 152, 121, 21)
$Input2 = GUICtrlCreateInput("Input2", 296, 72, 121, 21)
$Input3 = GUICtrlCreateInput("Input3", 392, 216, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
[COLOR="Red"]case $Button1
msgbox(0,"der Inhalt ist", $Input1)[/COLOR]
EndSwitch
WEnd
|
|
|
07/26/2009, 20:25
|
#4
|
elite*gold: 15
Join Date: Nov 2005
Posts: 13,021
Received Thanks: 5,324
|
#Falsches Forum
#moved
|
|
|
07/26/2009, 20:36
|
#5
|
elite*gold: 9
Join Date: Apr 2009
Posts: 10,163
Received Thanks: 3,810
|
Quote:
Originally Posted by gamerfreddie
Danke dir, so ein neues Problem, will das wenn man button 1 drückt er aus der Inputbox1 den text entnimmt und ihn in einer msgbox wieder gibt.
Bei mir zeigt er aber immer "6" an, anstatt den Inhalt der Inputbox oO
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 445, 192, 124)
$Button1 = GUICtrlCreateButton("Button1", 64, 176, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("Button2", 296, 96, 75, 25, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Button3", 408, 240, 75, 25, $WS_GROUP)
$Input1 = GUICtrlCreateInput("Input1", 56, 152, 121, 21)
$Input2 = GUICtrlCreateInput("Input2", 296, 72, 121, 21)
$Input3 = GUICtrlCreateInput("Input3", 392, 216, 121, 21)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
case $Button1
msgbox(0,"Der Inhalt ist", GUIctrlread($Input1))
EndSwitch
WEnd
|
GUIctrlread($Input1) ist es, habs reingebaut.
|
|
|
 |
Similar Threads
|
(Anfänger) Hilfe zu AutoIt
09/12/2010 - AutoIt - 3 Replies
'n schönen guten Morgen allerseits!
Das hier ist mein erstes Topic im Forum und es geht direkt mit einer Frage los...
Seit ein Paar Wochen beschäftige ich mich nebenbei mit AutoIt. Klappt auch dank guter Tutorials ganz gut. Heute wollte ich einmal ausprobieren, meinen Funktionen ein Koda GUI zuzuweisen. Das erstellen vom GUI ging auch problemlos, nur will es mir einfach nicht gelingen, dem GUI die passenden Funktionen hinzuzufügen! Ich hoffe ihr könnt mir dabei helfen.
Das hier ist das...
|
Autoit v3 für anfänger By Smile
09/02/2010 - AutoIt - 7 Replies
~Removed~
Wegen omer36
|
[Autoit]Anfänger Tutorial.
02/04/2010 - Tutorials - 5 Replies
Hallo, willkommen zu mein Tuturial für unsere Anfänger in AutoIt. Zumal will ich kurz klar machen, dass ich Understood bin. Wer sich überzeugen will, kann mir eine Mail senden im Bot Forum!
Vorwort: Ich musste die Autoit Tags durch die Code Tags ersetzen und die Bindestriche zwischen den Abteilungen einrücken / kürzen!
Außerdem ist zu wissen, dass, das Tutorial schon seine gewisse Zeit existiert, als ich es erstellt habe, habe ich noch nicht genau auf die Rechtschreibung geachet!
Hoffe...
|
[AutoIt] Anfänger Schwierigkeiten
04/12/2009 - General Coding - 5 Replies
Hallo Zusammen.
ich habe ein kleines (oder großes, ich hoffe nicht) Problem.
Ich möchte ein Programm für Silkroad in AutoIt schreiben.
Um es für alle Auflösungen gangbar zu machen, habe ich folgendes versucht:
$deskres = @DesktopHeight+@DesktopWidth // Berechnet die Summe aus Höhe mal Breite der Desktopauflösung
If $deskres = 2048 Then // für die Auflösung 1280 * 768
|
All times are GMT +1. The time now is 21:09.
|
|