删删 发表于 2011-2-16 11:12:06

请问 怎么让下边GUI内的按钮分别打开指定网址

请问 怎么让下边GUI内的按钮分别打开指定网址

#include <GUIConstantsEx.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)

Example()

Func Example()
    Local $tab, $tab0, $tabbt1, $tabbt2, $tabbt3, $tabbt4, $tabbt5, $tabbt6, $tabbt7, $tabbt8, $tabbt9, $tabbt10, $tabbt11, $tabbt12
    Local$msg

    GUICreate("My GUI Tab", 160, 305)
    GUISetBkColor(0x0eE0FeFF)
    GUISetFont(9, 300)
    $tab = GUICtrlCreateTab(1, 1, 160,305,$WS_DLGFRAME)
    $tab0 = GUICtrlCreateTabItem("连接")
        GUICtrlCreateGroup("网址",12,35,140,262,$WS_EX_CLIENTEDGE )
    GUICtrlCreateLabel("la9999999999999999el0", 20, 60, 90, 20)
        GUICtrlCreateLabel("label0", 20, 80, 50, 20)
        GUICtrlCreateLabel("label0", 20, 100, 50, 20)
        GUICtrlCreateLabel("label0", 20, 120, 50, 20)
        GUICtrlCreateLabel("label0", 20, 140, 50, 20)
        GUICtrlCreateLabel("label0", 20, 160, 50, 20)
        GUICtrlCreateLabel("label0", 20, 180, 50, 20)
        GUICtrlCreateLabel("label0", 20, 200, 50, 20)
        GUICtrlCreateLabel("label0", 20, 220, 50, 20)
        GUICtrlCreateLabel("label0", 20, 240, 50, 20)
        GUICtrlCreateLabel("label0", 20, 260, 50, 20)
        GUICtrlCreateLabel("label0", 20, 280, 50, 20)
        ;..................................................................
    $tabbt1 = GUICtrlCreateButton("OK0", 105, 55, 35, 20)
        $tabbt2 = GUICtrlCreateButton("OK0", 105, 75, 35, 20)
        $tabbt3 = GUICtrlCreateButton("OK0", 105, 95, 35, 20)
        $tabbt4= GUICtrlCreateButton("OK0", 105, 115, 35, 20)
        $tabbt5 = GUICtrlCreateButton("OK0", 105, 135, 35, 20)
        $tabbt6 = GUICtrlCreateButton("OK0", 105, 155, 35, 20)
        $tabbt7 = GUICtrlCreateButton("OK0", 105, 175, 35, 20)
        $tabbt8 = GUICtrlCreateButton("OK0", 105, 195, 35, 20)
        $tabbt9 = GUICtrlCreateButton("OK0", 105, 215, 35, 20)
        $tabbt10 = GUICtrlCreateButton("OK0", 105, 235, 35, 20)
        $tabbt11 = GUICtrlCreateButton("OK0", 105, 255, 35, 20)
        $tabbt12 = GUICtrlCreateButton("OK0", 105, 275, 35, 20)
          
       GUISetState()


    While 1
      $msg = GUIGetMsg()

      If $msg = $GUI_EVENT_CLOSE Then ExitLoop
      If $msg = $tab Then
         
            WinSetTitle("My GUI Tab", "", "My GUI Tab" & GUICtrlRead($tab))
      EndIf
    WEnd
EndFunc

水木子 发表于 2011-2-16 11:37:56

If $msg = $tabbt1 Then ShellExecute('www.autoitx.com')

将这行代码加到你的循环里试试!

删删 发表于 2011-2-16 13:08:15

谢谢版主问题解决
页: [1]
查看完整版本: 请问 怎么让下边GUI内的按钮分别打开指定网址