jboy012000
New member
Hi All,
Hope evryone is well,
I am writing an MDI Text Editor and I have written a sub routine for my save menu option, please see my code below.
This is close to working but when I click to save my work the save as dialog box keeps coming up, every time I press the save button.
I have tried everything I know to get this working, can anyone tell me what I am doing wrong.
CF by the way is a global variable with a String data type, I use it to keep track of the filename in the document.
Thanks very much
John
Hope evryone is well,
I am writing an MDI Text Editor and I have written a sub routine for my save menu option, please see my code below.
HTML:
'This sub routine updates the current document or calls the save as routine
Private Sub SaveToolStripButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripButton.Click, SaveToolStripMenuItem.Click
If CF = "" Then
SaveAsToolStripMenuItem.PerformClick()
Else
My.Computer.FileSystem.WriteAllText(CF, DirectCast(Me.ActiveMdiChild, Form2).RichTextBox1.Text, False)
End If
End Sub
This is close to working but when I click to save my work the save as dialog box keeps coming up, every time I press the save button.
I have tried everything I know to get this working, can anyone tell me what I am doing wrong.
CF by the way is a global variable with a String data type, I use it to keep track of the filename in the document.
Thanks very much
John