题目内容:
阅读以下说明和Visual Basic代码,将应填入(n)处的字句写在对应栏内。【说明】
以下代码实现了当用户退出界面时,判断TextEdit中的文字是否发生改变,弹出对话框判断,让用户选择是否保存文件或取消退出界面操作。阅读下面的代码,将其补充完整。
【代码7-1】
Begin VB.Form. Forml
//...窗体描述(略)
Begin VB.TextBox TextEdit
Height = 1830
Left = 180
Tablndex = 0
Text = "TextEdit"
Top = 360
Width = 3885
End
//...窗体描述(略)
End
【代码7-2】
Dim txtchange As Boolean
Dim myval As String
Private Sub Form. Load ()
TextEdit.Text: "CIU, 中国软考联盟!"
txtchange = False
End Sub
【代码7-3】
Private Sub TextEdit_Change ()
Static notchange As Boolean
(1)
notchange = Tree
End Sub
Private Sub Form_Unload ( Cancel As Integer )
Dim myval As String
If (2) Then
myval = MsgBox ( "保存文件的更改吗?", vbYesNoCancel, "提示信息" )
If (3) Then
MsgBox "保存成功"
End
End If
If (4) Then End
If (5) Then Cancel = 1
End If
End Sub
参考答案: