einfache lisbox

10/20/2011 22:03 playerXD97#1
Hallo bin noch etwas neu mit autit und wollte grad ein einfaches programm machen das wenn man was anklickt und auf den button klickt er das ausführt

hab grade das mit koda gemacht ist der grundsatz:
Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Test", 436, 279, 192, 124)
GUISetIcon("D:\Blitz2DDemo\blitzbasic.exe", -1)
$List1 = GUICtrlCreateList("", 16, 112, 161, 97, BitOR($GUI_SS_DEFAULT_LIST,$LBS_DISABLENOSCROLL))
GUICtrlSetData(-1, "Ort1|Ort2|Ort3|Ort4|Ort5")
$Button1 = GUICtrlCreateButton("FunktionA", 216, 96, 121, 81)
$Tab1 = GUICtrlCreateTab(0, 0, 433, 25)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

	EndSwitch
WEnd
und ich möchte gerne das wenn ich auf Ort 1 klicke und dann auf FunktionA er einen send Befehl ausführt kriege das aber leider nicht hin :(
bitte helft mir danke :handsdown:
10/20/2011 23:12 omer36#2
PHP Code:
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <GUIListBox.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 GUICreate("Test"436279192124)
GUISetIcon("D:\Blitz2DDemo\blitzbasic.exe", -1)
$List1 GUICtrlCreateList(""1611216197BitOR($GUI_SS_DEFAULT_LIST,$LBS_DISABLENOSCROLL))
GUICtrlSetData(-1"Ort1|Ort2|Ort3|Ort4|Ort5")
$Button1 GUICtrlCreateButton("FunktionA"2169612181)
$Tab1 GUICtrlCreateTab(0043325)
GUICtrlCreateTabItem("")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg 
GUIGetMsg()
    Switch 
$nMsg
        
Case $GUI_EVENT_CLOSE
            
Exit
        Case 
$Button1
                                                  
;dein Befehl
            
If GUICtrlRead($List1) == "Ort1" Then MsgBox("","","Ort1 ist aktive"
            If 
GUICtrlRead($List1) == "Ort2" Then MsgBox("","","Ort2 ist aktive")
            If 
GUICtrlRead($List1) == "Ort3" Then MsgBox("","","Ort3 ist aktive")
            ;...
    EndSwitch
WEnd