天啊?怎么会这样?
我在做一个记事本.我想在点击新建的时候会弹出对话框,让点击是,否,取消.点是保存,可是点 了否还是保存.代码如下:Private Sub mnunew_Click()
On Error Resume Next
Dim temptext As String
Dim i As Integer
temptext = RichTextBox1.Text
If temptext <> Empty Then
i = MsgBox("文件 无标题的文字已经改变。想保存文件吗?", vbQuestion + vbYesNoCancel, Me.Caption) '弹出是,否,取消对话框
i = 6 '点击是
CommonDialog1.Filter = "文本文档(*.txt)|*.txt|所有文件|*.*|"
CommonDialog1.ShowSave
RichTextBox1.SaveFile CommonDialog1.FileName, 1 '保存文件
temptext = RichTextBox1.Text
Exit Sub
i = 7 '点击否
Unload Me
i = 2 '点击取消
cancel = True
End If
On Error GoTo 0
RichTextBox1.Text = ""
End Sub
谁能帮我改下啊??