Tef
New member
Hi.
I'm new here, beginner in VB.Net and French. Then i'm very sorry for my english.
I learn VB.Net alone and i try to create a wordpad like with mdiform. But i have a problem with save text.
I don't know how save my richtextbox in my current mdichild.
My project :
frmMain = MDIParent
frmNew = mdiChild with a control RichTextBox (rtb)
Here my source code :
At the line "My.Computer.FileSystem.etc...." I've got ActivemdiChild.Text but i save the name of my document in my file and not the text.
I try to change my modifier to rtb Friend with Public but it's the same problem.
I use Visual Studio 2005 Beta 2.
Thanks a lot for your help and I'm very sorry for my bad english
Bye
I'm new here, beginner in VB.Net and French. Then i'm very sorry for my english.
I learn VB.Net alone and i try to create a wordpad like with mdiform. But i have a problem with save text.
I don't know how save my richtextbox in my current mdichild.
My project :
frmMain = MDIParent
frmNew = mdiChild with a control RichTextBox (rtb)
Here my source code :
VB.NET:
Try
With SDF
.AddExtension = False
.CheckPathExists = True
.CreatePrompt = False
.OverwritePrompt = True
.ValidateNames = True
.ShowHelp = True
.DefaultExt = "rtf"
.FileName = strFilename
.Filter = "RTF files (*.rtf) |*.rtf|TXT files (*.txt) |*.txt|All files|*.*"
.FilterIndex = 1
If .ShowDialog = DialogResult.OK Then
My.Computer.FileSystem.WriteAllText(.FileName, ActiveMdiChild.Text, False)
End If
End With
Catch ex As Exception
MessageBox.Show(ex.Message, Me.Text)
End Try
I try to change my modifier to rtb Friend with Public but it's the same problem.
I use Visual Studio 2005 Beta 2.
Thanks a lot for your help and I'm very sorry for my bad english
Bye