I have written a sub routine for a Save>Menu option for a MDI Text Editor, Please see my code below
Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click Dim f As Form2 If f.Text = "Text Editor V.2 - New Document" Then SaveAsToolStripMenuItem.PerformClick() Else (My.Computer.FileSystem.WriteAllText, DirectCast(Me.ActiveMdiChild, Form2).RichTextBox1.Text, False) End If End Sub
From this sub routine I get a syntax error, at the start of line 6, which reads (My.Computer.Filesystem........
Now if I take out the ( I get yet another error which states
"Argument not specified for perameter "File" of public sub WriteAllText(File as string, text as string, append as boolean)
All I want is when the user clicks the save menu item the document either saves the changes made to the current document or the save as routine is involked.
Can someone please take a look at my current sub routine and tell me what I have done wrong, or suggest an alternative.
Thanks very much
Edited by discovery-power: n/a