vb记事本程序编写有一点问题求指教
这学期选了vb选修课,学的不深,期末作业[Private Sub mnuFileOpen_Click()Dim sFile As String
CommonDialog1.Filter = "文本文档(*.txt)|*.txt|RTF文档(*.rtf)|*.rtf|所有文件(*.*)|*.*"
CommonDialog1.ShowOpen
RichTextBox1.Text = "" '清空文本框
FileName = CommonDialog1.FileName
RichTextBox1.LoadFile FileName
Me.Caption = "我的记事本:" & FileName
With dlgCommonDialog
.DialogTitle = "打开"
.CancelError = False
'ToDo: 设置 common dialog 控件的标志和属性
.Filter = "所有文件 (*.*)|*.*"
.ShowOpen
If Len(.FileName) = 0 Then
Exit Sub
End If
sFile = .FileName
End With
End Sub
'ToDo: 添加处理打开的文件的代码
Private Sub mnuFileSave_Click()
CommonDialog1.Filter = "文本文档(*.txt)|*.txt|RTF文档(*.rtf)|*.rtf|所有文件(*.*)|*.*"
CommonDialog1.ShowSave
FileType = CommonDialog1.FileTitle
FiType = LCase(Right(FileType, 3))
FileName = CommonDialog1.FileName
Select Case FiType
Case "txt"
RichTextBox1.SaveFile FileName, rtfText
Case "rtf"
RichTextBox1.SaveFile FileName, rtfRTF
Case "*.*"
RichTextBox1.SaveFile FileName
End Select
MsgBox "添加 'mnuFileSave_Click' 代码。"
End Sub
这个是打开和另存为运行之后打开框之后缺点什么求指教