Main menu

  • Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 625, 445, 192, 124)
    $MenuItem1 = GUICtrlCreateMenu("MenuItem1")
    $MenuItem3 = GUICtrlCreateMenuItem("MenuItem3", $MenuItem1)
    $MenuItem2 = GUICtrlCreateMenu("MenuItem2")
    $MenuItem4 = GUICtrlCreateMenuItem("MenuItem4", $MenuItem2)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

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

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

    EndSwitch
    WEnd

    [/autoit]

    Hier mal mein Script .
    Si ich brauche da mal hilfe undzwar möchte ich gerne wen man auf das menu ( MenuItem4 oder MenuItem3)
    drückt das die gui sich ändert , sprich wen ein Text darin enthalten ist , und man auf ( MenuItem4 oder MenuItem3) drückt das die gui sicht löscht und das sich zb. ein bild anzeigt mit einem text ,.

    Einmal editiert, zuletzt von Secret1994 (13. April 2010 um 17:55)

  • So meinst du?

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 625, 445, 192, 124)
    $Menu1 = GUICtrlCreateMenu("Menu1")
    $MenuItem1 = GUICtrlCreateMenuItem("MenuItem1", $Menu1)
    $Menu2 = GUICtrlCreateMenu("Menu1")
    $MenuItem2 = GUICtrlCreateMenuItem("MenuItem1", $Menu2)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $MenuItem1
    MsgBox(0,"","Item1")
    Case $MenuItem2
    MsgBox(0,"","Item2")
    EndSwitch
    WEnd

    [/autoit]
  • zum Löschen statt MsgBox... folgendes eingeben

    [autoit]

    GUIDElete($Form1)

    [/autoit]

    gruß Simon

  • Hallo Secret1994,

    dann vielleicht dieses Schema:

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    #Include <String.au3>

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

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1", 625, 445, 192, 124)
    $MenuItem1 = GUICtrlCreateMenu("MenuItem1")
    $MenuItem3 = GUICtrlCreateMenuItem("Label&1 zeigen", $MenuItem1)
    $MenuItem2 = GUICtrlCreateMenu("MenuItem2")
    $MenuItem4 = GUICtrlCreateMenuItem("Label&2 zeigen", $MenuItem2)
    $Label1 = GUICtrlCreateLabel(_StringRepeat("Test ",400),0,0,625,445)
    $Label2 = GUICtrlCreateLabel(_StringRepeat("noch ein Test ",4),100,100,425,245)
    GUICtrlSetState($Label2,$GUI_HIDE)
    GUISetState(@SW_SHOW,$Form1)

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

    #EndRegion ### END Koda GUI section ###

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

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    case $MenuItem3
    GUICtrlSetState($Label1,$GUI_SHOW)
    GUICtrlSetState($Label2,$GUI_HIDE)
    case $MenuItem4
    GUICtrlSetState($Label1,$GUI_HIDE)
    GUICtrlSetState($Label2,$GUI_SHOW)

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

    EndSwitch
    WEnd

    [/autoit]

    mfg (Auto)Bert