用vb做记事本

2025-01-03 04:36:47
推荐回答(1个)
回答1:

Private Sub mnuSave_Click()
CommonDialog1.Filter = "文本文档(*.txt)|*.txt|RTF文档(*.rtf)|*.rtf|所有文件(*.*)|*.*"
CommonDialog1.ShowSave
FileType = CommonDialog1.FileTitle
FiType = LCase(Right(FileType, 3))
Select Case FiType
Case "txt"

RichTextBox1.SaveFile CommonDialog1.filename, rtfText

Case "rtf"
RichTextBox1.SaveFile CommonDialog1.filename, rtfRTF

Case "*.*"
RichTextBox1.SaveFile CommonDialog1.filename

End Select
End Sub