Jump to content

write to textbox


jercfd
 Share

Recommended Posts

how do i make a FileOpenDialog command send the file path to a GUICtrlCreateInput text box?

While 1
Switch GUIGetMsg()
   Case $GUI_EVENT_CLOSE
      Exit
   Case $Browse1
      $path1 = FileOpenDialog("Select a file", @WorkingDir & "", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(4096,"Error","No File chosen")
      Else
         $var = StringReplace($path1, "|", @CRLF)
         MsgBox(4096,"File Choosen","You have selected " & $path1)
      EndIf
EndSwitch
WEnd
Link to comment
Share on other sites

updated code

While 1
Switch GUIGetMsg()
   Case $GUI_EVENT_CLOSE
      Exit
   Case $Browse1
      $path1 = FileOpenDialog("Select a file", @WorkingDir & "", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(4096,"Error","No File chosen")
      Else
         $path1 = StringReplace($path1, "|", @CRLF)
         MsgBox(4096,"File Choosen","You have selected " & $path1)
         $Input1 = $path1
      EndIf
EndSwitch
WEnd
Edited by jercfd
Link to comment
Share on other sites

updated code

While 1
Switch GUIGetMsg()
   Case $GUI_EVENT_CLOSE
      Exit
   Case $Browse1
      $path1 = FileOpenDialog("Select a file", @WorkingDir & "", "FLV Files (*.flv)", 1 + 2 )
      If @error Then
         MsgBox(4096,"Error","No File chosen")
      Else
         $path1 = StringReplace($path1, "|", @CRLF)
         MsgBox(4096,"File Choosen","You have selected " & $path1)
         $Input1 = $path1
      EndIf
EndSwitch
WEnd
You seem to intend to work with multi-line data, so you should be putting it in an Edit control vice and Input, but the methods are the same either way: GuiCtrlSetData() or ControlSetText()

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You seem to intend to work with multi-line data, so you should be putting it in an Edit control vice and Input, but the methods are the same either way: GuiCtrlSetData() or ControlSetText()

:)

Thanks, It now works. Thanks for the help.

:)

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...