Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles MyBase.Load
撤销.Enabled = False
剪切.Enabled = False
复制.Enabled = False
粘贴.Enabled = False
删除.Enabled = False
查找.Enabled = False
查找下一个.Enabled = False
转到.Enabled = False
状态栏.Enabled = False
End Sub
Private Sub Form1_Resize(ByVal sender As Object,ByVal e As System.EventArgs) Handles Me.Resize
TextBox1.Width = Me.Width - 10
TextBox1.Height = Me.Height - 10
End Sub
Private Sub TextBox1_Click(ByVal sender As Object,ByVal e As System.EventArgs) Handles TextBox1.Click
TextBox1.Focus()
End Sub
Private Sub TextBox1_MouseDown(ByVal sender As Object,ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseDown
撤销.Enabled = True
剪切.Enabled = True
复制.Enabled = True
粘贴.Enabled = True
删除.Enabled = True
查找.Enabled = True
查找下一个.Enabled = True
End Sub
Private Sub TextBox1_TextChanged(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles TextBox1.TextChanged
撤销.Enabled = True
查找.Enabled = True
查找下一个.Enabled = True
End Sub
Private Sub 撤销_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 撤销.Click
TextBox1.Text = ""
End Sub
Private Sub 自动换行_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 自动换行.Click
自动换行.Checked = True
End Sub
Private Sub 新建_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 新建.Click
TextBox1.Text = ""
End Sub
Private Sub 打开_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 打开.Click
OpenFileDialog1.ShowDialog()
End Sub
Private Sub 另存为_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 另存为.Click
SaveFileDialog1.ShowDialog()
End Sub
Private Sub 保存_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 保存.Click
SaveFileDialog1.ShowDialog()
End Sub
Private Sub 退出_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 退出.Click
End
End Sub
Private Sub 复制_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 复制.Click
TextBox1.Copy()
End Sub
Private Sub 粘贴_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 粘贴.Click
TextBox1.Paste()
End Sub
Private Sub 删除_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 删除.Click
TextBox1.SelectAll()
TextBox1.text=""
End Sub
Private Sub 时间日期_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 时间日期.Click
TextBox1.Text = Format(Now,"yyy-MM-dd hh:mm:ss")
End Sub
Private Sub 字体_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 字体.Click
FontDialog1.ShowDialog()
End Sub
Private Sub 剪切_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 剪切.Click
TextBox1.Cut()
End Sub
Private Sub 全选_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles 全选.Click TextBox1.SelectAll() End Sub End Class
原文链接:https://www.f2er.com/vb/260087.html