Probleme mit dem Slider

  • halli hallo,mich plagt mal wieder was.. dank UEZ hab ich jetzt in mein script eine lauftschrift drinne nur der slider macht jetzt probleme immer wenn ich den script starte sieht der slider erst immer so komisch aus als ob der hintergrund des sliders makiert wäre oder so in der art und erst wenn ich den anklick sieht der normal aus... bedank mich schonmal für eure hilfe da ich weiß sie kommt schnell :)


    Spoiler anzeigen
    [autoit]

    #include <GUIConstants.au3>
    #include <WindowsConstants.au3>

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

    GUICreate ("Extrem Stream 1.0",220,400, -1, -1, -1, $WS_EX_COMPOSITED) ;double buffering der GUI -> nur XP!
    GUISetState (@SW_SHOW)
    $start = GUICtrlCreateButton ("Play",10,30,95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $stop = GUICtrlCreateButton ("Stop",110,30,95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $start2 = GUICtrlCreateButton ("Play",10,100,95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $stop2 = GUICtrlCreateButton ("Stop",110,100,95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $start3 = GUICtrlCreateButton ("Play",10,165,95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $stop3 = GUICtrlCreateButton ("Stop",110,165,95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $start4 = GUICtrlCreateButton ("Play",10,225,95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $stop4 = GUICtrlCreateButton ("Stop",110,225,95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $start5 = GUICtrlCreateButton ("Play",10,295,95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $stop5 = GUICtrlCreateButton ("Stop",110,295,95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    GUICtrlCreateButton ("Hardstyle",25,2,165)
    GUICtrlCreateButton ("Heavy Metal/Rock",25,65,165)
    GUICtrlCreateButton ("Rmb/Black",25,132,165)
    GUICtrlCreateButton ("Chill Out",25,195,165)
    GUICtrlCreateButton ("Charts",25,260,165)
    $Slider1 = GUICtrlCreateSlider(4, 340, 210, 25)
    $label = GUICtrlCreateLabel(" Extrem Stream 1.0 created by: Gonzo", 201, 378, 600, 20)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBKColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetData($Slider1, 50)
    GUICtrlSetLimit(-1,100,0)
    $x = 201
    AdlibRegister("Scroll_Label", 30)
    #cs
    $oWMP = ObjCreate ("WMPLayer.ocx")
    $oWMP.URL = "http://85.12.25.90:7500"
    $oWMP.controls.play()
    #ce
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    AdlibUnRegister("Scroll_Label")
    Exit
    Case $start
    $oWMP = ObjCreate ("WMPLayer.ocx")
    $oWMP.URL = "http://85.12.25.90:7500"
    $oWMP.controls.play()
    Case $Stop
    $oWMP = ObjCreate ("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $slider1
    SoundSetWaveVolume(GUICtrlRead($slider1))
    Case $start2
    $oWMP = ObjCreate ("WMPLayer.ocx")
    $oWMP.URL = "http://208.53.138.151:8032/"
    $oWMP.controls.play()
    Case $Stop2
    $oWMP = ObjCreate ("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $slider1
    Case $start3
    $oWMP = ObjCreate ("WMPLayer.ocx")
    $oWMP.URL = "http://gffstream.ic.llnwd.net/stream/gffstream_mp3_w75a"
    $oWMP.controls.play()
    Case $Stop3
    $oWMP = ObjCreate ("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $slider1
    Case $start4
    $oWMP = ObjCreate ("WMPLayer.ocx")
    $oWMP.URL = "http://streaming.radionomy.com:8000/12XIIIIX12"
    $oWMP.controls.play()
    Case $Stop4
    $oWMP = ObjCreate ("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $slider1
    Case $start5
    $oWMP = ObjCreate ("WMPLayer.ocx")
    $oWMP.URL = "http://rs20.stream24.org:8000/stream"
    $oWMP.controls.play()
    Case $Stop5
    $oWMP = ObjCreate ("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $slider1
    EndSwitch

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

    WEnd

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

    Func Scroll_Label()
    GUICtrlSetPos($label, $x, 378)
    $x -= 1
    If $x = -610 Then $x = 201
    EndFunc

    [/autoit]



    Edit Oscar: Spoiler- und AutoIt-Tags eingefügt.

    Einmal editiert, zuletzt von Oscar (31. Januar 2010 um 11:09)

    • Offizieller Beitrag

    Das Problem hat weniger mit der Laufschrift zu tun, als viel mehr mit dem Befehl GUISetState.
    Diesen sollte man erst benutzen, nachdem man alle Controls für die GUI erstellt hat. Also so (GUISetState nach unten verschoben):

    Spoiler anzeigen
    [autoit]


    #include <GUIConstants.au3>
    #include <WindowsConstants.au3>

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

    GUICreate("Extrem Stream 1.0", 220, 400, -1, -1, -1, $WS_EX_COMPOSITED) ;double buffering der GUI -> nur XP!
    $start = GUICtrlCreateButton("Play", 10, 30, 95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $stop = GUICtrlCreateButton("Stop", 110, 30, 95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $start2 = GUICtrlCreateButton("Play", 10, 100, 95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $stop2 = GUICtrlCreateButton("Stop", 110, 100, 95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $start3 = GUICtrlCreateButton("Play", 10, 165, 95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $stop3 = GUICtrlCreateButton("Stop", 110, 165, 95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $start4 = GUICtrlCreateButton("Play", 10, 225, 95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $stop4 = GUICtrlCreateButton("Stop", 110, 225, 95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $start5 = GUICtrlCreateButton("Play", 10, 295, 95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    $stop5 = GUICtrlCreateButton("Stop", 110, 295, 95)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    GUICtrlCreateButton("Hardstyle", 25, 2, 165)
    GUICtrlCreateButton("Heavy Metal/Rock", 25, 65, 165)
    GUICtrlCreateButton("Rmb/Black", 25, 132, 165)
    GUICtrlCreateButton("Chill Out", 25, 195, 165)
    GUICtrlCreateButton("Charts", 25, 260, 165)
    $Slider1 = GUICtrlCreateSlider(4, 340, 210, 25)
    $label = GUICtrlCreateLabel(" Extrem Stream 1.0 created by: Gonzo", 201, 378, 600, 20)
    GUICtrlSetFont(-1, 12, 400, 0, "Comic Sans MS")
    GUICtrlSetColor(-1, 0xFF0000)
    GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
    GUICtrlSetData($Slider1, 50)
    GUICtrlSetLimit(-1, 100, 0)
    GUISetState(@SW_SHOW)
    $x = 201
    AdlibRegister("Scroll_Label", 30)
    #cs
    $oWMP = ObjCreate ("WMPLayer.ocx")
    $oWMP.URL = "http://85.12.25.90:7500"
    $oWMP.controls.play()
    #ce
    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    AdlibUnRegister("Scroll_Label")
    Exit
    Case $start
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://85.12.25.90:7500"
    $oWMP.controls.play()
    Case $stop
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $Slider1
    SoundSetWaveVolume(GUICtrlRead($Slider1))
    Case $start2
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://208.53.138.151:8032/"
    $oWMP.controls.play()
    Case $stop2
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $Slider1
    Case $start3
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://gffstream.ic.llnwd.net/stream/gffstream_mp3_w75a"
    $oWMP.controls.play()
    Case $stop3
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $Slider1
    Case $start4
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://streaming.radionomy.com:8000/12XIIIIX12"
    $oWMP.controls.play()
    Case $stop4
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $Slider1
    Case $start5
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.URL = "http://rs20.stream24.org:8000/stream"
    $oWMP.controls.play()
    Case $stop5
    $oWMP = ObjCreate("WMPLayer.ocx")
    $oWMP.controls.stop()
    Case $Slider1
    EndSwitch

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

    WEnd

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

    Func Scroll_Label()
    GUICtrlSetPos($label, $x, 378)
    $x -= 1
    If $x = -610 Then $x = 201
    EndFunc ;==>Scroll_Label

    [/autoit]
  • lol dann frag ich mich wie das da hingekomm is ^^ komisch komisch aber vielen dank wieder ein mägel beseitigt :) jetzt fehlt noch schwarzer hintergrund und rote buttons :)