Michael-Knight1 Posted August 12, 2012 Share Posted August 12, 2012 (edited) Hi , I Working into My First Tool 'FXP Edit' But I Have Some Problem on Open File Dialog . Anyone Can Fix Me This Script ?? Dim Open As New OpenFileDialog() Dim MyStreamReader As System.IO.StreamReader Open.Filter = "Text [*.fxp*]|*.*" Open.CheckFileExists = True Open.Title = "Open File" Open.ShowDialog() Try Open.OpenFile() myStreamReader = System.IO.File.OpenText(Open.FileName) Document.text = MyStreamReader.ReadToEndCatch ex As ExceptionEnd Try End Class Edited August 12, 2012 by Michael-Knight1 Link to comment Share on other sites More sharing options...
harrisonconde1 Posted August 12, 2012 Share Posted August 12, 2012 Hi , I Working into My First Tool 'FXP Edit' But I Have Some Problem on Open File Dialog .Anyone Can Fix Me This Script ?? Dim Open As New OpenFileDialog() Dim MyStreamReader As System.IO.StreamReader Open.Filter = "Text [*.fxp*]|*.*" Open.CheckFileExists = True Open.Title = "Open File" Open.ShowDialog() Try Open.OpenFile() myStreamReader = System.IO.File.OpenText(Open.FileName) Document.text = MyStreamReader.ReadToEndCatch ex As ExceptionEnd Try End Class I don't know why your code is bad, I tested it here and worked well, here goes a version made by me: 'Create an OpenFileDialog in the toolbox and edit the properties, in this case is "OP" Dim r As StreamReader op.ShowDialog() If Not op.FileName = Nothing Then Try r = New StreamReader(op.FileName) document.Text = r.readtoend Catch ex As Exception MsgBox(ex.Message) End Try End If Also, I don't think that this topic is in the right area, the right area is: http://www.gtaforums.com/index.php?showforum=9 Link to comment Share on other sites More sharing options...
Michael-Knight1 Posted August 12, 2012 Author Share Posted August 12, 2012 (edited) Hi , I Working into My First Tool 'FXP Edit' But I Have Some Problem on Open File Dialog .Anyone Can Fix Me This Script ?? Dim Open As New OpenFileDialog() Dim MyStreamReader As System.IO.StreamReader Open.Filter = "Text [*.fxp*]|*.*" Open.CheckFileExists = True Open.Title = "Open File" Open.ShowDialog() Try Open.OpenFile() myStreamReader = System.IO.File.OpenText(Open.FileName) Document.text = MyStreamReader.ReadToEndCatch ex As ExceptionEnd Try End Class I don't know why your code is bad, I tested it here and worked well, here goes a version made by me: 'Create an OpenFileDialog in the toolbox and edit the properties, in this case is "OP" Dim r As StreamReader op.ShowDialog() If Not op.FileName = Nothing Then Try r = New StreamReader(op.FileName) document.Text = r.readtoend Catch ex As Exception MsgBox(ex.Message) End Try End If Also, I don't think that this topic is in the right area, the right area is: http://www.gtaforums.com/index.php?showforum=9 tnx he doesn't work also ?? i have vb express 2010 Edited August 12, 2012 by Michael-Knight1 Link to comment Share on other sites More sharing options...
harrisonconde1 Posted August 13, 2012 Share Posted August 13, 2012 Hi , I Working into My First Tool 'FXP Edit' But I Have Some Problem on Open File Dialog .Anyone Can Fix Me This Script ?? Dim Open As New OpenFileDialog() Dim MyStreamReader As System.IO.StreamReader Open.Filter = "Text [*.fxp*]|*.*" Open.CheckFileExists = True Open.Title = "Open File" Open.ShowDialog() Try Open.OpenFile() myStreamReader = System.IO.File.OpenText(Open.FileName) Document.text = MyStreamReader.ReadToEndCatch ex As ExceptionEnd Try End Class I don't know why your code is bad, I tested it here and worked well, here goes a version made by me: 'Create an OpenFileDialog in the toolbox and edit the properties, in this case is "OP" Dim r As StreamReader op.ShowDialog() If Not op.FileName = Nothing Then Try r = New StreamReader(op.FileName) document.Text = r.readtoend Catch ex As Exception MsgBox(ex.Message) End Try End If Also, I don't think that this topic is in the right area, the right area is: http://www.gtaforums.com/index.php?showforum=9 tnx he doesn't work also ?? i have vb express 2010 explains the error... Link to comment Share on other sites More sharing options...
Ashwin.Star Posted August 14, 2012 Share Posted August 14, 2012 Stop using Quote if you you don't know Its Use, @M.k You Very Good do VB, keep doing me too searching that dialog box, Link to comment Share on other sites More sharing options...
Michael-Knight1 Posted August 14, 2012 Author Share Posted August 14, 2012 Stop using Quote if you you don't know Its Use, @M.k You Very Good do VB, keep doing me too searching that dialog box, Me Too I Search A dialog box And I Many Learn Tutorial About it And Now Any Result , i everyone get this problem Link to comment Share on other sites More sharing options...
Michael-Knight1 Posted August 15, 2012 Author Share Posted August 15, 2012 (edited) @Ashwin , Using This For Dialog Box ! Dim folder As String ' folder = BrowseForFolder(Me, "Select A Directory", "C:\startdir\anywhere" ) ' If Len(folder) = 0 Then Exit Sub 'User Selected Cancel Edited August 15, 2012 by Michael-Knight1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now