Jump to content
Sign in to follow this  
vladedoty

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

Recommended Posts

vladedoty

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
KaFu

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
vladedoty

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.