|
You last visited: Today at 02:40
Advertisement
Gui Button
Discussion on Gui Button within the AutoIt forum part of the Coders Den category.
05/12/2012, 21:59
|
#1
|
elite*gold: 0
Join Date: Oct 2011
Posts: 204
Received Thanks: 30
|
Gui Button
Hi Com, hab mir grade mit KODA eine Gui gebastelt und möchte jetzt wenn jmd zB. "Button1" drückt  aufgerufen wird...
Wie mache ich das?
|
|
|
05/12/2012, 22:04
|
#2
|
elite*gold: 0
Join Date: Mar 2011
Posts: 8,645
Received Thanks: 3,454
|
in der While schleife
PHP Code:
Case $Button1 ShellExecute("www.google.com")
|
|
|
05/12/2012, 22:08
|
#3
|
elite*gold: 0
Join Date: Oct 2011
Posts: 204
Received Thanks: 30
|
Ich bekomme den Fehler:
;### Tidy Error -> case is never closed in your script.
|
|
|
05/12/2012, 22:20
|
#4
|
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
|
Select
Case $Button1
ShellExecute("Google.com")
Case $Button2
...
EndSelect
Nächste mal bei so einer kleinen Frage bitte dort posten:
|
|
|
05/12/2012, 22:40
|
#5
|
elite*gold: 0
Join Date: Oct 2011
Posts: 204
Received Thanks: 30
|
Sry ich bin bischen zu blöd das umzusetzen, und auf Wunsch schreib ich jetzt mal im Thread weiter...
hier ist der Code, Kann mir jmd dass so hinbasteln?
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=c:\users\blindeagle\desktop\jar moddden\travianschnellzugriff.kxf
$Form1_1 = GUICreate("Form1", 598, 421, 282, 127)
$Pic1 = GUICtrlCreatePic("C:\Users\BlindEagle\Desktop\jar moddden\travian_05.jpg", 0, 0, 617, 433)
$LoginButton = GUICtrlCreateButton("LoginButton", 32, 384, 137, 33)
GUICtrlSetOnEvent(-1, "LoginButtonClick")
$TTButton = GUICtrlCreateButton("Getter-Tools (TT", 240, 384, 137, 33)
GUICtrlSetOnEvent(-1, "TTButtonClick")
$InaktivenButton = GUICtrlCreateButton("Inaktiven-Liste", 424, 384, 137, 33)
GUICtrlSetCursor (-1, 2)
GUICtrlSetOnEvent(-1, "InaktivenButtonClick")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func InaktivenButtonClick()
EndFunc
Func LoginButtonClick()
EndFunc
Func TTButtonClick()
EndFunc
|
|
|
05/12/2012, 22:54
|
#6
|
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
|
Koda sollte dir eig. unter deinem GUI Code so eine Schleife generiert haben:
Code:
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Unter das letzte "Case" kannst du nun Case $Button1 einfügen.
Die ControlID, in deinem Fall nun $Button1 findest du im GUI Code vor "= GUICtrlCreateButton".
Mach am besten ein paar anfänger Tutorials. Denn jede Kleinichkeit solltest du hier auch nicht fragen
|
|
|
05/12/2012, 22:59
|
#7
|
elite*gold: 0
Join Date: Oct 2011
Posts: 204
Received Thanks: 30
|
Komisch aber das hat es nicht....
den Code den ich gepostet habe is direkt vom Koda Output
|
|
|
05/12/2012, 23:02
|
#8
|
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
|
Naja, dann füge einfach
Code:
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
in deine While Schleife ein.
|
|
|
05/12/2012, 23:11
|
#9
|
elite*gold: 0
Join Date: Oct 2011
Posts: 204
Received Thanks: 30
|
So hab ich :
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=c:\users\blindeagle\desktop\jar moddden\travianschnellzugriff.kxf
$Form1_1 = GUICreate("Form1", 598, 421, 282, 127)
$Pic1 = GUICtrlCreatePic("C:\Users\BlindEagle\Desktop\jar moddden\travian_05.jpg", 0, 0, 617, 433)
$LoginButton = GUICtrlCreateButton("LoginButton", 32, 384, 137, 33)
GUICtrlSetOnEvent(-1, "LoginButtonClick")
$TTButton = GUICtrlCreateButton("Getter-Tools (TT", 240, 384, 137, 33)
GUICtrlSetOnEvent(-1, "TTButtonClick")
$InaktivenButton = GUICtrlCreateButton("Inaktiven-Liste", 424, 384, 137, 33)
GUICtrlSetCursor (-1, 2)
GUICtrlSetOnEvent(-1, "InaktivenButtonClick")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func InaktivenButtonClick()
EndFunc
Func LoginButtonClick()
EndFunc
Func TTButtonClick()
$nMsg = GUIGetMsg()
Switch $nMsg
Case $LoginButton
ShellExecute("wwww.Google.de")
Exit
EndSwitch
EndFunc
Es funzt aber immer noch nicht  ...
Bin wahrscheinlich zu müde, Kannst du es schnell machen, ich setzt mich dann morgen nochmal dran und werd es versuchen nachzuvollziehen...
|
|
|
05/12/2012, 23:31
|
#10
|
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
|
Quote:
Originally Posted by Lawliet!
Naja, dann füge einfach
Code:
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
in deine While Schleife ein.
|
Ne, learning by doing^^
|
|
|
05/12/2012, 23:38
|
#11
|
elite*gold: 0
Join Date: Oct 2011
Posts: 204
Received Thanks: 30
|
Ja aber da passiert ja nix wenn ich das in die schleife einfüge.....
Probier mal bei dir aus ob es bei dir geht
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=c:\users\blindeagle\desktop\jar moddden\travianschnellzugriff.kxf
$Form1_1 = GUICreate("Form1", 598, 421, 282, 127)
$Pic1 = GUICtrlCreatePic("C:\Users\BlindEagle\Desktop\jar moddden\travian_05.jpg", 0, 0, 617, 433)
$LoginButton = GUICtrlCreateButton("LoginButton", 32, 384, 137, 33)
$TTButton = GUICtrlCreateButton("Getter-Tools (TT", 240, 384, 137, 33)
$InaktivenButton = GUICtrlCreateButton("Inaktiven-Liste", 424, 384, 137, 33)
GUICtrlSetCursor (-1, 2)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Case $LoginButton
ShellExecute("www.Google.de")
Exit
EndSwitch
WEnd
EDIT: Habs jetzt bestimmt über 50mal andere Kombinationen probiert nix geht -.-
|
|
|
05/12/2012, 23:56
|
#12
|
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
|
Case $LoginButton
ShellExecute("www.Google.de")
Unter das Exit.
Eine Switch Schleife ist immer so aufgebaut:
Switch <expression>
Case $button1
-tudas-
Case $button2
-tudies-
EndSwitch
|
|
|
05/13/2012, 00:03
|
#13
|
elite*gold: 0
Join Date: Oct 2011
Posts: 204
Received Thanks: 30
|
Quote:
Originally Posted by Lawliet!
Case $LoginButton
ShellExecute("www.Google.de")
Unter das Exit.
Eine Switch Schleife ist immer so aufgebaut:
Switch <expression>
Case $button1
-tudas-
Case $button2
-tudies-
EndSwitch
|
Ah also Case $LoginButton einfach unter machen
Code:
While 1
Sleep(100)
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $LoginButton
ShellExecute("www.Google.de")
EndSwitch
WEnd
geht aber immer noch nicht, hab das gefühl man kann nicht auf die draufklicken :O
EDIT: Es liegt wirklich an den Buttons -.- Iwie is draufklciken deaktiviert :O
EDIT2: Das problem liegt am Bild, man muss es auf "Enabled: false" setzen damit es funktioniert, ansonsten kann man die Buttons nicht drücken, keine Angst das Bild sieht man trotzdem
Vielen dank an alle Helfer, Funktioniert jetzt
|
|
|
05/13/2012, 00:19
|
#14
|
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
|
#closed
|
|
|
 |
Similar Threads
|
Help me in Button
05/04/2012 - C/C++ - 5 Replies
it is work but button ok don't work can help me ? i went after select .exe and chick open and go chick ok button to open it don't work so i don't add thing the button ok idk what add to work and when chick ok open .exe can help?
Public Class Form1
Private TargetProcessHandle As Integer
Private pfnStartAddr As Integer
Private pszLibFileRemote As String
Private TargetBufferSize As Integer
Public Const PROCESS_VM_READ = &H10
Public Const TH32CS_SNAPPROCESS = &H2
|
Item-Shop Lager Button Zum Normalen lager button machen? DE
01/12/2011 - Metin2 - 6 Replies
Moin,
seid heute gib es ja im inventar den IS button wo man mit sein lager öffnen kann,könnte man den auch zu einem Normalen lager Button Machen?
|
Button ; <
04/11/2010 - AutoIt - 19 Replies
Hey!
How i can set to button run exe program?
I click to button and next program (exe) started
thanks
|
WarRock statt KOREANISCHE BUTTON --> Englische BUTTON
02/26/2010 - WarRock - 6 Replies
Bin mir nicht sicher ob es diesen Thread schon gibt
aber hab bis jetzt nichts gesehen hier.
Funktionen
Für WarRock Korea
Koreanische Schriften (Button) weg und englische Schriften (Button) hin
Anleitung
|
All times are GMT +1. The time now is 02:41.
|
|