bsplin 发表于 2008-5-6 03:15:20

koda生成的状态栏代码出错,请大家帮忙!

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <StatusBarConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("测试状态栏", 300, 95, 347, 272)
$Label1 = GUICtrlCreateLabel("测试状态栏", 112, 32, 64, 17)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
Dim $StatusBar1_PartsWidth =
_GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsWidth)
_GUICtrlStatusBar_SetText($StatusBar1, "第一部分", 0)
_GUICtrlStatusBar_SetText($StatusBar1, "第二部分", 1)
_GUICtrlStatusBar_SetText($StatusBar1, "第三部分", 2)
_GUICtrlStatusBar_SetMinHeight($StatusBar1, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

以上代码为最新版autoit里的koda生成的状态栏的代码,但运行会出错。不知为什么,请大家帮忙!谢谢!

[ 本帖最后由 bsplin 于 2008-5-7 20:59 编辑 ]

小三 发表于 2008-5-6 10:46:48

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <StatusBarConstants.au3>
#include <WindowsConstants.au3>
#include <GuiStatusBar.au3>   ;-------------------------------这里

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("测试状态栏", 300, 95, 347, 272)
$Label1 = GUICtrlCreateLabel("测试状态栏", 112, 32, 64, 17)
$StatusBar1 = _GUICtrlStatusBar_Create($Form1)
Dim $StatusBar1_PartsWidth =
_GUICtrlStatusBar_SetParts($StatusBar1, $StatusBar1_PartsWidth)
_GUICtrlStatusBar_SetText($StatusBar1, "第一部分", 0)
_GUICtrlStatusBar_SetText($StatusBar1, "第二部分", 1)
_GUICtrlStatusBar_SetText($StatusBar1, "第三部分", 2)
_GUICtrlStatusBar_SetMinHeight($StatusBar1, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

bsplin 发表于 2008-5-7 20:56:37

感谢回复,果然好用了!:face (33):
页: [1]
查看完整版本: koda生成的状态栏代码出错,请大家帮忙!