24-11-13, 04:44 PM
1. نضيف الاداة SaveFileDialog الى form
2. نضيف button الى الفورم
3. ثم في حدث ال button نتكتب الكود التالي
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SaveFileDialog1.Filter = "txt|*.txt"
SaveFileDialog1.ShowDialog()
If SaveFileDialog1.FileName <> "" Then
FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
PrintLine(1, TextBox1.Text)
FileClose(1)
End If
End Sub
2. نضيف button الى الفورم
3. ثم في حدث ال button نتكتب الكود التالي
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SaveFileDialog1.Filter = "txt|*.txt"
SaveFileDialog1.ShowDialog()
If SaveFileDialog1.FileName <> "" Then
FileOpen(1, SaveFileDialog1.FileName, OpenMode.Output)
PrintLine(1, TextBox1.Text)
FileClose(1)
End If
End Sub

