|
 |
|
|
|
|
|
GTA Modification Forums
Need Help With VB Open File Dialog
 |
|
 |
| |
Michael-Knight1  |
|
Never Give UP

Group: Members
Joined: Jul 8, 2012


|
| QUOTE (harrisonconde1 @ Sunday, Aug 12 2012, 21:51) | | QUOTE (Michael-Knight1 @ Sunday, Aug 12 2012, 20:41) | Hi , I Working into My First Tool 'FXP Edit' But I Have Some Problem on Open File Dialog . Anyone Can Fix Me This Script ??
| CODE | 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.ReadToEnd Catch ex As Exception End 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"
| CODE | 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 This post has been edited by Michael-Knight1 on Sunday, Aug 12 2012, 22:16
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
harrisonconde1  |
|
potato

Group: Members
Joined: Aug 12, 2012


|
| QUOTE (Michael-Knight1 @ Sunday, Aug 12 2012, 22:14) | | QUOTE (harrisonconde1 @ Sunday, Aug 12 2012, 21:51) | | QUOTE (Michael-Knight1 @ Sunday, Aug 12 2012, 20:41) | Hi , I Working into My First Tool 'FXP Edit' But I Have Some Problem on Open File Dialog . Anyone Can Fix Me This Script ??
| CODE | 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.ReadToEnd Catch ex As Exception End 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"
| CODE | 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...
|
|
|
|
|
 |
|
 |
 |
|
 |
| |
0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)
0 Members:
Track this topic
Receive email notification when a reply has been made to this topic and you are not active on the board.
Subscribe to this forum
Receive email notification when a new topic is posted in this forum and you are not active on the board.
Download / Print this Topic
Download this topic in different formats or view a printer friendly version.
| |
 |
|
 |
|
|
|
|