一次将5个富文本框的内容保存到一个文本文件中 [英] Save 5 rich text box enteries at one time to one text file

查看:74
本文介绍了一次将5个富文本框的内容保存到一个文本文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我当前正在使用下面的代码,该代码使我可以将一个富文本框条目保存到文本文件(单词形式):请参见代码:

I am currently using the code below that lets me save one rich text box entry to a text file (word form): Please see code:

 Private Sub SaveToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SaveToolStripMenuItem.Click
    Try
        Dim dlg As SaveFileDialog = New SaveFileDialog
        dlg.Title = "Save"
        dlg.Filter = "Rich Text Files(*.rtf)|*.rtf"

        If dlg.ShowDialog() = System.Windows.Forms.DialogResult.OK Then
            RichTextBox1.SaveFile(dlg.FileName, RichTextBoxStreamType.RichText)

        End If

    Catch ex As Exception : End Try
End Sub


这段代码很好用,但是我想知道是否有人可以一次使用5个或更多个富文本框并将其保存到文本文件(单词形式)中,只需单击一下按钮即可.


This code works great but I was wondering if someone could please help in a code for using 5 or even more rich text box at one time and saving them to a text file (word form) at a click of a button.

推荐答案

使用此替代方法 RichTextBox.SaveFile方法(Stream, RichTextBoxStreamType) [ ^ ]
Use this override method RichTextBox.SaveFile Method (Stream, RichTextBoxStreamType)[^]


这篇关于一次将5个富文本框的内容保存到一个文本文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆