Ok. At the moment I have a form, with pretty much jack all working. I have basic things working, things that I have tought myself to do, burt there is one thing I am stuck on which I just can't figure out.
When pressing 'Ok' in the OpenFileDialog, I want the file, which is a .java file, to open into a RichTextBox, or a Text box, where I can edit the .java file, then save it using the SaveFileDialog.
Currently I have:
Which seems to be too short, which is why I think it doesn't work. When I try to use this, I choose the .java file, press Ok, and then it stops, and in the debugger it comes up with:
I am guessing this is because it is a .java file, and I want to know how I can fix this so it opens it correctly. I know there is a way to open the .java files, because a friend of mine, whom I can't seem to contact, has done it before.
Thanks,
Budda
NOTE:
.java files layout is just normal writing. It can be opened and edited perfectly with notepad.
When pressing 'Ok' in the OpenFileDialog, I want the file, which is a .java file, to open into a RichTextBox, or a Text box, where I can edit the .java file, then save it using the SaveFileDialog.
Currently I have:
VB.NET:
[SIZE=2]
[/SIZE][SIZE=2][COLOR=#0000ff]Private[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub[/COLOR][/SIZE][SIZE=2] OpenFile_FileOk([/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] sender [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.Object, [/SIZE][SIZE=2][COLOR=#0000ff]ByVal[/COLOR][/SIZE][SIZE=2] e [/SIZE][SIZE=2][COLOR=#0000ff]As[/COLOR][/SIZE][SIZE=2] System.ComponentModel.CancelEventArgs) [/SIZE][SIZE=2][COLOR=#0000ff]Handles[/COLOR][/SIZE][SIZE=2] OpenFile.FileOk
RichTextBox1.LoadFile(OpenFile.FileName)
[/SIZE][SIZE=2][COLOR=#0000ff]End[/COLOR][/SIZE][SIZE=2] [/SIZE][SIZE=2][COLOR=#0000ff]Sub
[/COLOR][/SIZE]
VB.NET:
File Format is not valid
Thanks,
Budda
NOTE:
.java files layout is just normal writing. It can be opened and edited perfectly with notepad.