[Solved!]New save format?
If your a member of codenstuff then this is the main place to be. Get together..talk..chat and ponder. Have fun. Chill out. Play games.
4 posts
Page 1 of 1
Well I have been working on many programs for Minecraft and mods, but today is not the time to talk about it.
I'm looking for some help making a program which opens a new format like the ones after the name of something EX. .png .txt .java etc.
I want the program to open a file .mmg format and then showing up the text on a richtextbox then after you can save it to a .java not back to a .mmg
Is this possible? I think so but I am greatly bad with coding.
NOTE: In VB.NET Please
I'm looking for some help making a program which opens a new format like the ones after the name of something EX. .png .txt .java etc.
I want the program to open a file .mmg format and then showing up the text on a richtextbox then after you can save it to a .java not back to a .mmg
Is this possible? I think so but I am greatly bad with coding.
NOTE: In VB.NET Please
Last edited by Frozen on Fri Dec 02, 2011 10:46 pm, edited 1 time in total.
It is indeed possible, and here is one way of doing it:
1. Put this to open the file
Sincerely,
Comathi
1. Put this to open the file
Code: Select all
2. And now for the save
Try
Dim dlg As New OpenFileDialog
dlg.Title = "Open File..."
dlg.Filter = "MMG Files (*.mmg) | *.mmg"
If dlg.ShowDialog = DialogResult.Ok Then
RichTextBox1.LoadFile (dlg.filename, PlainText)
End If
Catch ex As Exception
End Try
Code: Select all
For the parts where it says "PlainText", you'll have to erase part of the word so VB starts giving you suggestions. From the list it should give you, just select the one that contains the "Plain Text". Sorry for any typos, I'm on a mobile device right now, but I hope this helps Try
Dim dlg As New SaveFileDialog
dlg.Title = "Save File..."
dlg.Filter = "Java Files (*.java) | *.java"
If dlg.ShowDialog = DialogResult.Ok Then
RichTextBox1.SaveFile (dlg.filename, PlainText)
End If
Catch ex As Exception
End Try

Sincerely,
Comathi

comathi wrote:It is indeed possible, and here is one way of doing it:Comathi thanks I really do appreciate it! I got it to work after figuring out that puzzle about the "PlainText" but all I needed to do is reread it
1. Put this to open the fileCode: Select all2. And now for the saveTry Dim dlg As New OpenFileDialog dlg.Title = "Open File..." dlg.Filter = "MMG Files (*.mmg) | *.mmg" If dlg.ShowDialog = DialogResult.Ok Then RichTextBox1.LoadFile (dlg.filename, PlainText) End If Catch ex As Exception End Try
Code: Select allFor the parts where it says "PlainText", you'll have to erase part of the word so VB starts giving you suggestions. From the list it should give you, just select the one that contains the "Plain Text". Sorry for any typos, I'm on a mobile device right now, but I hope this helpsTry Dim dlg As New SaveFileDialog dlg.Title = "Save File..." dlg.Filter = "Java Files (*.java) | *.java" If dlg.ShowDialog = DialogResult.Ok Then RichTextBox1.SaveFile (dlg.filename, PlainText) End If Catch ex As Exception End Try
Sincerely,
Comathi

You're welcome
Just tell me if you need any more help 
And sorry for the puzzle


And sorry for the puzzle

4 posts
Page 1 of 1
Copyright Information
Copyright © Codenstuff.com 2020 - 2023