Sign in to follow this  
Followers 0
vladedoty

How do i display a file in an input box after browsing?

3 posts in this topic

#1 ·  Posted (edited)

How do I display a file after browsing and selecting it.

inputbox variable is

$txtBatchPath = GUICtrlCreateInput("", 105, 117, 129, 19)

here is the browse code:

Case $cmdSelectBatchPath
     ;load batch
     BatchPath()

and the function"

func BatchPath()
    $batchPath = FileOpenDialog("", "C:\", "Batch (*.bat)")
EndFunc
Edited by vladedoty

Share this post


Link to post
Share on other sites



Your request is not quiet clear. Set filepath in the input control (option 1), or display the file content itself (option 2 is one way).

func BatchPath()
    $batchPath = FileOpenDialog("", "C:\", "Batch (*.bat)")
    If not @error Then
        GUICtrlSetData($txtBatchPath,$batchPath) ; Option 1
        ShellExecute($batchPath,'','','edit') ; Option 2
    endif
EndFunc

Share this post


Link to post
Share on other sites

Your request is not quiet clear. Set filepath in the input control (option 1), or display the file content itself (option 2 is one way).

func BatchPath()
    $batchPath = FileOpenDialog("", "C:\", "Batch (*.bat)")
    If not @error Then
        GUICtrlSetData($txtBatchPath,$batchPath) ; Option 1
        ShellExecute($batchPath,'','','edit') ; Option 2
    endif
EndFunc

Thanks alot!! Option 1 is what I was looking for.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0