Register for your free account! | Forgot your password?

You last visited: Today at 10:40

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

Advertisement



Hilfe

Discussion on Hilfe within the AutoIt forum part of the Coders Den category.

Reply
 
Old   #1
 
Copex™'s Avatar
 
elite*gold: 37
Join Date: Nov 2011
Posts: 934
Received Thanks: 480
Hilfe

Hey Com,


Hab vor kurzem mit dem "Scripten" mit AutoIt angefangen und wollte mal nachfragen wie man so einen Kasten mit Koda hin bekommt(es sollten dann auch halt verschiedene Optionen wen man es aufruft ausgesucht werden können ).






MFG °MyEliteShooter
Copex™ is offline  
Old 06/08/2012, 16:53   #2
 
elite*gold: 0
Join Date: Mar 2011
Posts: 8,645
Received Thanks: 3,454
Das ist eine ComboBox, müsste in Koda auch so heißen.
Und neue Items kannst du mit GUICtrlSetData erstellen.

Freddy​ is offline  
Old 06/08/2012, 16:55   #3
 
Copex™'s Avatar
 
elite*gold: 37
Join Date: Nov 2011
Posts: 934
Received Thanks: 480
ja die hab ich da auch schon gesehen , ich will nur gerne wissen wie man die richtig einsetzen kann , es wäre nett wen jemand ein beispiel Script posten könnte .
Copex™ is offline  
Old 06/08/2012, 16:58   #4
 
elite*gold: 0
Join Date: Mar 2011
Posts: 8,645
Received Thanks: 3,454
Steht da doch.

PHP Code:
#include <GUIConstantsEx.au3>

Example()

Func Example()
    
Local $msg
    GUICreate
("My GUI combo") ; will create a dialog box that when displayed is centered

    GUICtrlCreateCombo
("item1"1010) ; create first item
    GUICtrlSetData
(-1"item2|item3""item3") ; add other item snd set a new default

    
GUISetState()

    ; 
Run the GUI until the dialog is closed
    
While 1
        $msg 
GUIGetMsg()

        If 
$msg $GUI_EVENT_CLOSE Then ExitLoop
    WEnd
EndFunc   
;==>Example 
Freddy​ is offline  
Thanks
1 User
Old 06/08/2012, 17:01   #5
 
Copex™'s Avatar
 
elite*gold: 37
Join Date: Nov 2011
Posts: 934
Received Thanks: 480
Ok ,danke .

Ich hätte da aber noch eine Frage , kann man das auch so machen das wen jemand dort etwas auswählt das dann auch ein Text kommt wo z.B steht "Hallo" ?
Copex™ is offline  
Old 06/08/2012, 17:18   #6
 
elite*gold: 0
Join Date: Mar 2009
Posts: 7,260
Received Thanks: 33,147
Statt "ItemX" einfach "Hallo" nehmen. Wenn du den Text eines Labels ändern möchtest, kannst du den Inhalt der Combobox mit GUICtrlRead() Abfragen und das Label mit Hilfe von GUICtrlSetData() ändern.
KDeluxe is offline  
Old 06/08/2012, 17:32   #7
 
Copex™'s Avatar
 
elite*gold: 37
Join Date: Nov 2011
Posts: 934
Received Thanks: 480
ich will das wen man auf "Hallo2" klickt , dass dann dort wo der rote Kasten ist eine Info kommt . (Script wäre nett , wenn es geht sollte da dann auch ein Bild erscheinen , wenn man es auswählt).
Copex™ is offline  
Old 06/08/2012, 17:55   #8


 
Lawliet's Avatar
 
elite*gold: 2
Join Date: Jul 2009
Posts: 14,456
Received Thanks: 4,685
GuictrlCreateLabel() und fürs Bild GuictrlcreatePic(). Wir sind nicht hier um dir alles fertig zu präsentieren. Nimm dir unsere Tipps vor und setz sich in Eigenarbeit um.
Lawliet is offline  
Old 06/08/2012, 20:20   #9
 
Copex™'s Avatar
 
elite*gold: 37
Join Date: Nov 2011
Posts: 934
Received Thanks: 480
So weit bin ich auch , ich will nur wissen wie man das denn nun verbinden kann , sodass dann erscheint wen man auf das dazu gehörige Feld klickt .


PS: ("Script wäre nett <- ich meine ja nur das es nett wäre und nicht das es zwingend nötig ist .)
Copex™ is offline  
Old 06/08/2012, 20:44   #10

 
Njahs's Avatar
 
elite*gold: 574
Join Date: Nov 2010
Posts: 2,498
Received Thanks: 726
Code:
#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <GUICombobox.au3>

#region ### START Koda GUI section ### Form=
$Form = GUICreate("Test", 503, 94, 192, 164)
$TestCombo = GUICtrlCreateCombo("", 120, 32, 121, 25)
GUICtrlSetData(-1, "Gemüse|Fastfood")
_GUICtrlComboBox_SetCurSel(-1, 0)

$Label1 = GUICtrlCreateLabel("Was essen sie leiber?", 8, 35, 107, 17)
$Group1 = GUICtrlCreateGroup("", 272, 8, 201, 73)
$ResultLabel = GUICtrlCreateLabel("Sie essen Gemüse lieber.", 325, 38, 200, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#endregion ### END Koda GUI section ###

Global $sSelection = GUICtrlRead($TestCombo)

While 1

	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
	EndSwitch

	If GUICtrlRead($TestCombo) <> $sSelection Then
		Global $sSelection = GUICtrlRead($TestCombo)
		GUICtrlSetData($ResultLabel, "Sie essen " & $sSelection & " lieber.")
	EndIf

	Sleep(50)
WEnd
Nicht die beste Lösung, aber naja.
Ich glaube es gibt dafür sogar ein Beispiel in der Hilfe Oo
Njahs is offline  
Thanks
1 User
Old 06/08/2012, 20:46   #11
 
Copex™'s Avatar
 
elite*gold: 37
Join Date: Nov 2011
Posts: 934
Received Thanks: 480
genau das habe ich gesucht ;D danke <3333333
Copex™ is offline  
Reply




All times are GMT +2. The time now is 10:40.


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.