高手求救啊!!!
高手,求救啊!使用VB程序,设计一个具有复制、剪切、粘贴、保存、字体设置、字型设置、关闭、退出等功能的记事本。很紧急测试用的,请讲得详细一点。要所有步骤,可以让我照着做,...
高手,求救啊!使用VB程序,设计一个具有复制、剪切、粘贴、保存、字体设置、字型设置、关闭、退出等功能的记事本。很紧急 测试用的,请讲得详细一点。要所有步骤,可以让我照着做,谢谢,我的邮箱是1328075083@qq.com
展开
1个回答
展开全部
Private Sub Form_Load()
text1.Width = Form1.Width
text1.Left = 0
text1.Top = 0
text1.Height = Form1.Height
text1.Text = ""
End Sub
Private Sub Form_Resize()
text1.Width = Form1.Width
text1.Height = Form1.Height
End Sub
Private Sub iCopy_Click()
Clipboard.Clear
Clipboard.SetText text1.SelText
End Sub
Private Sub iCut_Click()
Clipboard.Clear
Clipboard.SetText text1.SelText
text1.Text = Replace(text1.Text, text1.SelText, "")
' CommonDialog
End Sub
Private Sub iFontSet_Click()
Form2.Show
End Sub
Private Sub iOut_Click()
Unload Me
End Sub
Private Sub iPaste_Click()
text1.Text = text1.Text & " " & Clipboard.GetText
End Sub
Private Sub iSave_Click()
CMD1.DialogTitle = "保存"
CMD1.Filter = "文本文件(*.txt)|*.txt|全部文件(*.*)|*.*|*.doc|"
CMD1.ShowSave
If Len(CMD1.FileName) = 0 Then: Exit Sub
Open CMD1.FileName For Output As #1
Write #1, Trim(text1.Text)
Close #1
'Dim strTemp As String
'
'strTemp = InputBox("请输入文件名", "输入框")
'
'text1.SaveFile strTemp
End Sub
Private Sub text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyC And (Shift And vbCtrlMask) Then
Clipboard.Clear
Clipboard.SetText text1.SelText
End If
If KeyCode = vbKeyS And (Shift And vbCtrlMask) Then
CMD1.ShowSave
End If
End Sub
当天亲手写的,实现效果和记事本一样
text1.Width = Form1.Width
text1.Left = 0
text1.Top = 0
text1.Height = Form1.Height
text1.Text = ""
End Sub
Private Sub Form_Resize()
text1.Width = Form1.Width
text1.Height = Form1.Height
End Sub
Private Sub iCopy_Click()
Clipboard.Clear
Clipboard.SetText text1.SelText
End Sub
Private Sub iCut_Click()
Clipboard.Clear
Clipboard.SetText text1.SelText
text1.Text = Replace(text1.Text, text1.SelText, "")
' CommonDialog
End Sub
Private Sub iFontSet_Click()
Form2.Show
End Sub
Private Sub iOut_Click()
Unload Me
End Sub
Private Sub iPaste_Click()
text1.Text = text1.Text & " " & Clipboard.GetText
End Sub
Private Sub iSave_Click()
CMD1.DialogTitle = "保存"
CMD1.Filter = "文本文件(*.txt)|*.txt|全部文件(*.*)|*.*|*.doc|"
CMD1.ShowSave
If Len(CMD1.FileName) = 0 Then: Exit Sub
Open CMD1.FileName For Output As #1
Write #1, Trim(text1.Text)
Close #1
'Dim strTemp As String
'
'strTemp = InputBox("请输入文件名", "输入框")
'
'text1.SaveFile strTemp
End Sub
Private Sub text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyC And (Shift And vbCtrlMask) Then
Clipboard.Clear
Clipboard.SetText text1.SelText
End If
If KeyCode = vbKeyS And (Shift And vbCtrlMask) Then
CMD1.ShowSave
End If
End Sub
当天亲手写的,实现效果和记事本一样
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询