本帖最后由 minghui 于 2010-9-20 23:04 编辑
#include <GUIConstants.au3>
;#include <ButtonConstants.au3>
;#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiEdit.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 288, 433, 427, 173)
$Edit1 = GUICtrlCreateEdit("", 152, 8, 129, 393)
GUICtrlSetData(-1, "")
$Label1 = GUICtrlCreateLabel("请导入代码:", 52, 16, 88, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$Button1 = GUICtrlCreateButton("浏 览", 56, 48, 65, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$message = "浏览文件"
$MyDocsFolder = "::{450D8FBA-AD25-11D0-98A8-0800361B1103}"
$sFile = FileOpenDialog($message, $MyDocsFolder, "文本文件 (*.txt)", 1 + 1)
_GUICtrlEdit_SetText($Edit1, FileRead($sFile))
EndSwitch
WEnd
是不是这样呢 |