IMG

 
IMG
IMG   IMG
  Welcome to GTAForums! Be sure to check out the Grand Theft Auto V Forum.

You are not registered! (If you are, click here to login) Registering is fast, free and easy and allows you to instantly reply to any topic on GTAForums.
Why wait? Click here to register your own unique username and become part of the ever-growing community!


( Log In | Register | Revalidate Validation E-mail )
Quick Log-In:
  IMG
       
>
Forum Rules GTA Modification Forums

Please post mod releases in the Mod Showroom

GTAGarage.com
free mod hosting from GTANet, simply login with your GTAForums account details

GTAModding.com
GTANet's modding wiki

GTA Modding Chatroom
provided by irc.gtanet.com (Don't have an IRC client? Click here)


  Reply to this topicStart new topicStart Poll

 Need Help With VB

 Open File Dialog
 
Michael-Knight1  
Posted: Sunday, Aug 12 2012, 20:41
Quote Post


Never Give UP
Group Icon
Group: Members
Joined: Jul 8, 2012

gr.gif

XXXXX



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


This post has been edited by Michael-Knight1 on Sunday, Aug 12 2012, 20:55
Users WebsitePM
  Top
 

 
harrisonconde1  
Posted: Sunday, Aug 12 2012, 21:51
Quote Post


potato
Group Icon
Group: Members
Joined: Aug 12, 2012

ba.gif

XXXXX



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
wink.gif
PM
  Top
 

 
Michael-Knight1  
Posted: Sunday, Aug 12 2012, 22:14
Quote Post


Never Give UP
Group Icon
Group: Members
Joined: Jul 8, 2012

gr.gif

XXXXX



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
wink.gif

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
Users WebsitePM
  Top
 

 
harrisonconde1  
Posted: Monday, Aug 13 2012, 14:33
Quote Post


potato
Group Icon
Group: Members
Joined: Aug 12, 2012

ba.gif

XXXXX



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
wink.gif

tnx he doesn't work also ?? i have vb express 2010

explains the error...
PM
  Top
 

 
Ashwin the new boy  
Posted: Tuesday, Aug 14 2012, 12:31
Quote Post


I am The Most Confused Person
Group Icon
Group: Members
Joined: Nov 14, 2010

ia.gif

XXXXX



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,
Users WebsitePM
  Top
 

 
Michael-Knight1  
Posted: Tuesday, Aug 14 2012, 19:04
Quote Post


Never Give UP
Group Icon
Group: Members
Joined: Jul 8, 2012

gr.gif

XXXXX



QUOTE (Ashwin the new boy @ Tuesday, Aug 14 2012, 12:31)
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 cryani.gif
Users WebsitePM
  Top
 

 
Michael-Knight1  
Posted: Wednesday, Aug 15 2012, 00:28
Quote Post


Never Give UP
Group Icon
Group: Members
Joined: Jul 8, 2012

gr.gif

XXXXX



@Ashwin , Using This For Dialog Box !
CODE

Dim folder As String
'    folder = BrowseForFolder(Me, "Select A Directory", "C:\startdir\anywhere" )
'    If Len(folder) = 0 Then Exit Sub  'User Selected Cancel


This post has been edited by Michael-Knight1 on Wednesday, Aug 15 2012, 08:06
Users WebsitePM
  Top
 

 

0 User(s) are reading this topic (0 Guests and 0 Anonymous Users)

0 Members:

Topic Options Reply to this topicStart new topicStart Poll
Search topic for posted by (exact match)



 
IMG IMG