Problem mit einem Label und Guictrlsetdata

  • Hai Leute Ich wollte heute einen kleine webradio machen aber es gibt ein paa probleme!

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    $vSender = IniRead( "Data.txt", "Sender", "", "")

    [/autoit] [autoit][/autoit] [autoit]

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Online Radios", 248, 156, 197, 128)
    GUISetFont(9, 400, 0, "Arial")
    $Combo1 = GUICtrlCreateCombo("", 8, 8, 233, 25, BitOR($CBS_DROPDOWNLIST,$CBS_AUTOHSCROLL,$CBS_OEMCONVERT,$CBS_SORT))
    GUICtrlSetData(-1, $vSender)
    $Progress1 = GUICtrlCreateProgress(128, 136, 105, 17)
    $Label1 = GUICtrlCreateLabel("Bitte waehlen sie einen Sender aus", 8, 136, 114, 19)

    [/autoit] [autoit][/autoit] [autoit]

    $Button1 = GUICtrlCreateButton("STart", 72, 88, 97, 33, $WS_GROUP)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Combo1
    $sBtnLabel = GUICtrlRead($Label1)
    Switch $sBtnLabel
    Case "Bitte waehlen sie einen Sender aus"
    GUICtrlSetData($Progress1, "25")
    ;~ Sleep(500)
    GUICtrlSetData($Label1, "Der Sender wird gesucht!")
    Case "Sender gefunden!"
    GUICtrlSetData($Progress1, "75")
    Case "Der Sender wird gesucht!"
    GUICtrlSetData($Progress1, "50")
    Sleep(500)
    GUICtrlSetData($Label1, "Sender gefunden!")
    EndSwitch
    Case $Label1

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]


    1.wie kann ich machen das wenn der jetzt in der combox technobase und hr3 zur auswahl sind das der wen ich auf technobase drücke technobase sucht und wen ich auf hr3 drücke hr3 sucht?
    2.

    [autoit]

    Case $Combo1
    $sBtnLabel = GUICtrlRead($Label1)
    Switch $sBtnLabel
    Case "Bitte waehlen sie einen Sender aus"
    GUICtrlSetData($Progress1, "25")
    ;~ Sleep(500)
    GUICtrlSetData($Label1, "Der Sender wird gesucht!")
    Case "Sender gefunden!"
    GUICtrlSetData($Progress1, "75")
    Case "Der Sender wird gesucht!"
    GUICtrlSetData($Progress1, "50")
    Sleep(500)
    GUICtrlSetData($Label1, "Sender gefunden!")
    EndSwitch

    [/autoit]


    dieser teil funktiniert nicht und ich weis nicht wieso

  • Hallo [CF[*Gaming*],

    mach es so:

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <ComboConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <ProgressConstants.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $sIniName = @ScriptDir & "\Data.txt"
    $aSender = IniReadSection($sIniName, "Sender")

    [/autoit] [autoit][/autoit] [autoit]

    #region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Online Radios", 248, 156, 197, 128)
    GUISetFont(9, 400, 0, "Arial")
    $Combo1 = GUICtrlCreateCombo("", 8, 8, 233, 25, BitOR($CBS_DROPDOWNLIST, $CBS_AUTOHSCROLL, $CBS_OEMCONVERT, $CBS_SORT))
    If IsArray($aSender) Then
    For $i = 1 To $aSender[0][0]
    GUICtrlSetData($Combo1, $aSender[$i][0])
    Next
    EndIf
    $Progress1 = GUICtrlCreateProgress(128, 136, 105, 17)
    $Label1 = GUICtrlCreateLabel("Bitte waehlen sie einen Sender aus", 8, 136, 114, 19)

    [/autoit] [autoit][/autoit] [autoit]

    $Button1 = GUICtrlCreateButton("STart", 72, 88, 97, 33, $WS_GROUP)
    GUISetState(@SW_SHOW)
    #endregion ### END Koda GUI section ###

    [/autoit] [autoit][/autoit] [autoit]

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Combo1
    $sBtnLabel = GUICtrlRead($Label1)
    Switch $sBtnLabel
    Case "Bitte waehlen sie einen Sender aus"
    GUICtrlSetData($Progress1, "25")
    Sleep(500)
    GUICtrlSetData($Label1, "Der Sender wird gesucht!")
    ContinueCase
    Case "Der Sender wird gesucht!"
    GUICtrlSetData($Progress1, "50")
    Sleep(500)
    GUICtrlSetData($Label1, "Sender gefunden!")
    Case "Sender gefunden!"
    GUICtrlSetData($Progress1, "75")
    ContinueCase
    EndSwitch
    $sSenderBez = GUICtrlRead($Combo1)
    $sSenderComand = IniRead($sIniName,"Sender",$sSenderBez,"")
    ConsoleWrite($sSenderBez & ", " & $sSenderComand & @CRLF)
    Case $Label1

    [/autoit] [autoit][/autoit] [autoit]

    EndSwitch
    WEnd

    [/autoit]

    bei INI einlesen habe ich auch Änderungen vorgenommen

    mfg autoBert

    Einmal editiert, zuletzt von autoBert (28. August 2010 um 17:11)