Save RichTextBox to my MDIFrom

Tef

New member
Joined
Nov 27, 2005
Messages
2
Location
Parcieux (France)
Programming Experience
Beginner
Hi.
I'm new here, beginner in VB.Net and French. Then i'm very sorry for my english. :D

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
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 :eek:

Bye
 
Bonjour et merci de répondre en Français :D
Bah le pb est que je n'ai pas encore de réponse mis à part une ou deux mais le pb est pas résolu. Et je cherche depuis un moment donc je mets toutes les chances de mon côté :)

Si vous avez une aide, ce serait super sympa.
Je vous remercie beaucoup par avance :)
 
Back
Top