ฟอรั่ม PSsix

Would you like to react to this message? Create an account in a few clicks or log in to continue.

ฟอรั่มของบล็อก http://pssix.blogspot.com


4 posters

    ถามข้อสงสัยเกี่ยวกับ GUI

    avatar
    xxxautoit
    PSsix Member
    PSsix Member


    ถามข้อสงสัยเกี่ยวกับ GUI Empty ถามข้อสงสัยเกี่ยวกับ GUI Empty
    จำนวนข้อความ : 28
    ความนิยม : 0
    เข้าร่วมเมื่อ : 16/08/2011

    ถามข้อสงสัยเกี่ยวกับ GUI Empty ถามข้อสงสัยเกี่ยวกับ GUI

    ตั้งหัวข้อ by xxxautoit 19/09/11, 04:05 pm

    ถ้าผมทำขี้นมาสักหน้าหนึ่ง แล้วอย่าให้คลิ๊กเมนูเพิ่มหน้าได้จะต้องทำเช่นไรครับ

    เช่น คลิ๊กไปที่ เมนู--ออฟชั่น (แล้ว หน้าใหม่โผล่มา หน้าเก่าก็ยังอยู่)
    แล้ว คลิ๊กไปที่ เมนู--about (อีกหน้าก็โหล่ขี้นมา ) อะไรประมาณนี้นะครับ

    จะต้องเขียนยังไงครับ

    (ขอบคุณไว้ล่วงหน้าครับ)
    aut
    aut
    PSsix Powerful Scripting Class
    PSsix Powerful Scripting Class


    PSsix Game Coder
    จำนวนข้อความ : 472
    ความนิยม : 126
    เข้าร่วมเมื่อ : 24/07/2010

    ถามข้อสงสัยเกี่ยวกับ GUI Empty Re: ถามข้อสงสัยเกี่ยวกับ GUI

    ตั้งหัวข้อ by aut 19/09/11, 06:38 pm

    จัดปาย ชินจัง

    #include <GUIConstantsEx.au3>
    #include <WindowsConstants.au3>
    $Form1 = GUICreate("เมพจิงม้ายต้องใช้โปรแกรมแปล", 421, 231, 335, 310)
    $MenuItem1 = GUICtrlCreateMenu("หมูหนู")
    $MenuItem5 = GUICtrlCreateMenuItem("ออปชั้น1", $MenuItem1)
    $MenuItem4 = GUICtrlCreateMenuItem("ออปชั้น2", $MenuItem1)
    $MenuItem6 = GUICtrlCreateMenuItem("ปิดสะ", $MenuItem1)
    $MenuItem2 = GUICtrlCreateMenu("หนูหมู")
    $MenuItem3 = GUICtrlCreateMenuItem("about", $MenuItem2)

    $Form2 = GUICreate("2222", 327, 178, -1, -1)
    $Edit2 = GUICtrlCreateEdit("", 24, 16, 273, 113)
    GUICtrlSetData(-1, StringFormat("ม้ายยากอ่านะ ใครก้อทำได้เหอเหอ\r\n22222222222222222"))
    $222 = GUICtrlCreateButton("222222", 104, 144, 75, 25)


    $Form3 = GUICreate("33333333", 327, 178, -1, -1)
    $Edit3 = GUICtrlCreateEdit("", 24, 16, 273, 113)
    GUICtrlSetData(-1, StringFormat("ม้ายยากอ่านะ ใครก้อทำได้เหอเหอ\r\n3333333333333333"))
    $333 = GUICtrlCreateButton("3333333", 104, 144, 75, 25)

    $Form4 = GUICreate("จาเอาอีกหรา", 327, 178, -1, -1)
    $Edit4 = GUICtrlCreateEdit("", 24, 16, 273, 113)
    GUICtrlSetData(-1, StringFormat("ฟวห่กดวสฟหาก่ดสฟหกดวส \r\n****************"))
    $444 = GUICtrlCreateButton("ดอทเอไหมสาด", 104, 144, 75, 25)


    GUISetState(@SW_SHOW, $Form1)
    #endregion ### END Koda GUI section ###

    While 1
    $nMsg = GUIGetMsg(1)

    Switch $nMsg[1]

    Case $Form1
    Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE
    Exit
    Case $MenuItem1
    Case $MenuItem5
    GUISetState(@SW_SHOW, $Form2)
    Case $MenuItem4
    GUISetState(@SW_SHOW, $Form3)
    Case $MenuItem6
    Exit

    Case $MenuItem3
    GUISetState(@SW_SHOW, $Form4)
    EndSwitch

    Case $Form2
    Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_HIDE, $Form2)
    Case $222
    MsgBox(1, "อัน2", "เหอเหอ")
    EndSwitch


    Case $Form3
    Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_HIDE, $Form3)
    Case $333
    MsgBox(1, "อัน3", "เหอเหอ")
    EndSwitch

    Case $Form4
    Switch $nMsg[0]
    Case $GUI_EVENT_CLOSE
    GUISetState(@SW_HIDE, $Form4)
    Case $444
    MsgBox(1, "อะเบ้า", "งิงิ")
    EndSwitch
    EndSwitch
    WEnd
    avatar
    xxxautoit
    PSsix Member
    PSsix Member


    ถามข้อสงสัยเกี่ยวกับ GUI Empty ถามข้อสงสัยเกี่ยวกับ GUI Empty
    จำนวนข้อความ : 28
    ความนิยม : 0
    เข้าร่วมเมื่อ : 16/08/2011

    ถามข้อสงสัยเกี่ยวกับ GUI Empty Re: ถามข้อสงสัยเกี่ยวกับ GUI

    ตั้งหัวข้อ by xxxautoit 20/09/11, 05:38 am

    ขอบคุณครับ
    POS
    POS
    PSsix
    PSsix


    ถามข้อสงสัยเกี่ยวกับ GUI Empty ถามข้อสงสัยเกี่ยวกับ GUI Empty ถามข้อสงสัยเกี่ยวกับ GUI Empty
    จำนวนข้อความ : 1152
    ความนิยม : 326
    เข้าร่วมเมื่อ : 19/07/2010

    ถามข้อสงสัยเกี่ยวกับ GUI Empty Re: ถามข้อสงสัยเกี่ยวกับ GUI

    ตั้งหัวข้อ by POS 20/09/11, 08:37 am

    ถ้าจะทำแบบง่ายๆ ก็เอาหน้าต่าง GUI อีกอันหนึ่งใส่ไว้ในฟังก์ชันแล้วเรียกขึ้นมาก็ได้ ตัวอย่าง

    Code:
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>

    #Region ### START Koda GUI section ### Form=
    $Form1 = GUICreate("Form1",320, 238, 192, 124)
    $MenuItem1 = GUICtrlCreateMenu("Option")
    $MenuItem3 = GUICtrlCreateMenuItem("เปิด GUI2", $MenuItem1)
    $MenuItem4 = GUICtrlCreateMenu("About")
    $MenuItem2 = GUICtrlCreateMenuItem("เปิด GUI 3", $MenuItem4)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###


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

    Case $MenuItem3
              Show1()
          Case $MenuItem2
                Show2()
       EndSwitch
    WEnd

    Func Show1()
    $Form1 = GUICreate("Form1", 271, 141, 192, 124)
    $Button1 = GUICtrlCreateButton("Button1", 176, 48, 75, 25)
    $Radio1 = GUICtrlCreateRadio("Radio1", 32, 16, 113, 17)
    $Radio2 = GUICtrlCreateRadio("Radio2", 32, 48, 113, 17)
        GUISetState()

       While 1
            Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                    GUIDelete($Form1)
                    ExitLoop
             Case $Button1
                MsgBox(0,"GUI2","GUI2")
          EndSwitch
       WEnd
    EndFunc


    Func Show2()
    $Form1 = GUICreate("Form1", 215, 234, 192, 124)
    $Button1 = GUICtrlCreateButton("Button1", 120, 24, 75, 25)
    $Button2 = GUICtrlCreateButton("Button2", 120, 72, 75, 25)
    $Button3 = GUICtrlCreateButton("Button3", 120, 120, 75, 25)
    $Button4 = GUICtrlCreateButton("Button4", 120, 168, 75, 25)
        GUISetState()

          While 1
            Switch GUIGetMsg()
                Case $GUI_EVENT_CLOSE
                    GUIDelete($Form1)
                    ExitLoop
                Case $Button1
                MsgBox(0,"GUI3","GUI3")
                Case $Button2
                MsgBox(0,"GUI3","GUI3")
                Case $Button3
                MsgBox(0,"GUI3","GUI3")
                Case $Button4
                MsgBox(0,"GUI3","GUI3")
          EndSwitch
       WEnd
    EndFunc
    Pochi
    Pochi
    PSsix Member Class III
    PSsix Member Class III


    ถามข้อสงสัยเกี่ยวกับ GUI Empty
    จำนวนข้อความ : 66
    ความนิยม : 1
    เข้าร่วมเมื่อ : 22/10/2010

    ถามข้อสงสัยเกี่ยวกับ GUI Empty Re: ถามข้อสงสัยเกี่ยวกับ GUI

    ตั้งหัวข้อ by Pochi 13/08/12, 03:56 pm

    ขอบคุณสำหรับข้อมูลครับ em230

      เวลาขณะนี้ 28/03/24, 05:54 pm