[Frage] <Browse>_Button..HowTo?

04/04/2009 19:55 buFFy!#1
edited
04/04/2009 20:23 kknb#2
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("GW Path Finder", 269, 85, 193, 125)
$Group1 = GUICtrlCreateGroup("GW Path", 8, 8, 249, 65)
$Input1 = GUICtrlCreateInput("Input1", 24, 32, 121, 21)
$Browse = GUICtrlCreateButton("...", 152, 32, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		case $Browse
			$bla = FileOpenDialog("öffnen",@scriptdir,"alle (*.*)",1)
			guictrlsetdata($Input1,$bla)
	EndSwitch
WEnd
der pfad zur datei wird dann in der variablen gespeichert.
04/04/2009 20:47 buFFy!#3
Quote:
Originally Posted by kknb View Post
Code:
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("GW Path Finder", 269, 85, 193, 125)
$Group1 = GUICtrlCreateGroup("GW Path", 8, 8, 249, 65)
$Input1 = GUICtrlCreateInput("Input1", 24, 32, 121, 21)
$Browse = GUICtrlCreateButton("...", 152, 32, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		case $Browse
			$bla = FileOpenDialog("öffnen",@scriptdir,"alle (*.*)",1)
			guictrlsetdata($Input1,$bla)
	EndSwitch
WEnd
der pfad zur datei wird dann in der variablen gespeichert.
Fettes Thanks :eek:
04/04/2009 21:21 kknb#4
hier nochn kleines "gimmic"

wenn ihr den code so übernimmt könnt ihr auch files per drag&drop in das inputfeld ziehen.

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

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("GW Path Finder", 269, 85, 193, 125,-1, 0x10)
$Group1 = GUICtrlCreateGroup("GW Path", 8, 8, 249, 65)
$Input1 = GUICtrlCreateInput("", 24, 32, 121, 21)
guictrlsetstate(-1,8) 
$Browse = GUICtrlCreateButton("...", 152, 32, 75, 25, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit
		case $Browse
			$bla = FileOpenDialog("öffnen",@scriptdir,"alle (*.*)",1)
			guictrlsetdata($Input1,$bla)
	EndSwitch
WEnd