请教一下如何在窗口上设置一个浏览功能的button控件[已解决]
本帖最后由 dpale 于 2013-1-12 22:23 编辑起始位置固定在我的文档,指向新的文件目录并关闭后,可以记住最后一次指向的文件目录,这要如何实现呢 demo
set.ini
documentfolder=My Documents
default=USERPROFILE
last=
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 623, 449, 192, 114)
$Input1 = GUICtrlCreateInput("Input1", 40, 40, 417, 21)
$Button1 = GUICtrlCreateButton("Button1", 512, 32, 73, 41)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$defaultdir = EnvGet(IniRead(@ScriptDir & "\set.ini", "set", "default", "")) & "\" & IniRead(@ScriptDir & "\set.ini", "set", "documentfolder", "")
$lastdir = IniRead(@ScriptDir & "\set.ini", "set", "last", "")
If $lastdir = "" Then
$lastdir = $defaultdir
EndIf
GUICtrlSetData($Input1, $lastdir)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
IniWrite(@ScriptDir & "\set.ini", "set", "last", $lastdir)
Exit
Case $Button1
$folder = FileSelectFolder("请选择目录", "")
If $folder <> "" Then
If $folder <> $lastdir Then
$lastdir = $folder
GUICtrlSetData($Input1, $lastdir)
EndIf
EndIf
EndSwitch
WEnd
回复 2# veket_linux
{:face (88):}非常感谢您的帮助,可以了,我自己来研究一下
页:
[1]