学生档案管理系统(5)
作者:佚名; 更新时间:2014-12-05
示部分文本", , "警告"
Exit Sub
End If

Screen.MousePointer = 11 '设置鼠标为沙漏

FileNum = FreeFile() '获得可用文件号
Open FileName For Input As FileNum '以顺序输入方式打开文件

Do While Not EOF(FileNum) And Len(buffer) < MaxLen '读必须文本小于 32K
Line Input #FileNum, buffer1 '读一行文字
buffer = buffer + buffer1 + Chr(13) + Chr(10) '加入回车换行符
Loop '循环体

Close FileNum '关闭文件

ImgUndoDisable '取消 Undo 功能

Text1.Text = buffer '显示文本
UndoNew = buffer '保存文本
buffer = "" '释放内存
buffer1 = ""
Screen.MousePointer = 0 '恢复鼠标指针
Me.Caption = "记事本 - " + FileName '修改标题显示
End If
End Sub

Private Sub Paste_Click()
Text1.SelText = Clipboard.GetText
End Sub

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1 = "工具栏"
End Sub

Private Sub Picture1_Resize()
If Picture1.Width > Label1.Left Then
Label1.Width = Picture1.ScaleWidth - Label1.Left
End If
End Sub

Private Sub Save_Click()
Dim FileNum As Integer '文件句柄号

CommonDialog1.ShowSave '显示保存对话框
If Len(CommonDialog1.FileName) > 0 Then
'有输入文件名
FileName = CommonDialog1.FileName '保存文件名
FileNum = FreeFile() '获得可用文件号
Open FileName For Output As FileNum '打开输出文件
'如果无指定文件,则创建新文件
Print #FileNum, Text1.Text '输出文本
Close FileNum '关闭文件
Me.Caption = "记事本 - " + FileName '修改标题显示
ImgUndoDisable
End If
End Sub

Private Sub Text1_Change()
If Not ImgUndo.Enabled Then
'使“Undo”按钮可用
ImgUndoEnable
End If
UndoString = UndoNew
UndoNew = Text1
End Sub

Private Sub Text1_Click()
Check_ImgCutCopy
End Sub

Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
Check_ImgCutCopy
End sub

核心期刊快速发表
Copyright@2000-2030 论文期刊网 Corporation All Rights Reserved.
《中华人民共和国信息产业部》备案号:ICP备07016076号;《公安部》备案号:33010402003207
本网站专业、正规提供职称论文发表和写作指导服务,并收录了海量免费论文和数百个经国家新闻出版总署审批过的具有国内统一CN刊号与国际标准ISSN刊号的合作期刊,供诸位正确选择和阅读参考,免费论文版权归原作者所有,谨防侵权。联系邮箱:256081@163.com