📄 form1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "判断文件是否被改动"
ClientHeight = 2700
ClientLeft = 60
ClientTop = 345
ClientWidth = 4185
LinkTopic = "Form1"
ScaleHeight = 2700
ScaleWidth = 4185
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Command1
Caption = "退出"
Height = 360
Left = 2400
TabIndex = 1
Top = 2265
Width = 1665
End
Begin VB.TextBox Text1
Height = 1830
Left = 180
TabIndex = 0
Text = "Text1"
Top = 360
Width = 3885
End
Begin VB.Label Label1
BackStyle = 0 'Transparent
Caption = "请输入文本"
Height = 345
Left = 225
TabIndex = 2
Top = 105
Width = 3720
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim txtchange As Boolean
Dim myval As String
Private Sub Form_Load()
Text1.Text = "vb程序员,vb程序员"
txtchange = False
End Sub
Private Sub Text1_Change()
Static notchange As Boolean
txtchange = notchange
notchange = True
End Sub
Private Sub Form_Unload(Cancel As Integer)
Dim myval As String
If txtchange = True Then
myval = MsgBox("保存文件的更改吗?", vbYesNoCancel, "提示信息")
If myval = vbYes Then
MsgBox "保存成功"
End
End If
If myval = vbNo Then End
If myval = vbCancel Then Cancel = 1
End If
End Sub
Private Sub Command1_Click()
If txtchange = True Then
myval = MsgBox("保存文件的更改吗?", vbYesNoCancel, "提示信息")
If myval = vbYes Then
MsgBox "保存成功"
End
End If
If myval = vbNo Then End
If myval = vbcanle Then
End If
Else
End
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -