Ok So I am trying to save text from a textbox to a rtf file. The Saves Text would come from the active mdi Child. However I can not figure out how to Save using active child just calling the actual form name. Below is my code so far.
Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles SaveAsToolStripMenuItem.Click
Try
Dim myfile As String
Dim saveFileDialog1 As New SaveFileDialog()
myfile = ActiveMdiChild.Text
saveFileDialog1.OverwritePrompt = True
saveFileDialog1.FileName = myfile
saveFileDialog1.Filter = "Rich Text Format (*.rtf)|*.rtf|All files (*.*)|*.*"
saveFileDialog1.ShowDialog()
If saveFileDialog1.FileName = "" Then
Exit Sub
End If
' this part saves the file
FileSystem.FileOpen(1, saveFileDialog1.FileName, OpenMode.Output)
FileSystem.Print(1, Cant figure out )'this is where i need the help!!
FileSystem.FileClose(1)
Catch
MessageBox.Show("No File To Save Exist", "Save Error", MessageBoxButtons.OK, _
MessageBoxIcon.Error)
End Try
End Sub
This is how I create new windows from the parent
Private windowNumber As Integer = 0 ' for display in title bar
Private Sub NewToolStripMenuItem_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles NewToolStripMenuItem.Click
windowNumber += 1
Me.LayoutMdi(MdiLayout.ArrangeIcons)
Dim appEditorForm As New textEditorForm
appEditorForm.MdiParent = Me
appEditorForm.Text = "Window " & windowNumber ' set title
appEditorForm.Show()
End Sub
Thanks In advance