打桩和送桩的区别:vb求助啊~~~ vb高手请进!!!

来源:百度文库 编辑:神马品牌网 时间:2024/05/03 03:19:52
关于用richtextbox对象
那为高手能帮我写出关于对与它的粘贴,复制,剪切,撤消,重复的实现代码啊!写出的送20分

这是我以前写的可以通用。

关于撤销和重复 我再给你写。
Private Sub 复制_Click()
Clipboard.Clear
If TypeOf Screen.ActiveControl Is TextBox Then
Clipboard.SetText Screen.ActiveControl.SelText
ElseIf TypeOf Screen.ActiveControl Is ComboBox Then
Clipboard.SetText Screen.ActiveControl.Text
ElseIf TypeOf Screen.ActiveControl Is PictureBox Then
Clipboard.SetData Screen.ActiveControl.Picture
ElseIf TypeOf Screen.ActiveControl Is PictureBox Then
Clipboard.SetText Screen.ActiveControl.Text
ElseIf TypeOf Screen.ActiveControl Is DBGrid Then
If DBGrid1.AllowUpdate = True Then Clipboard.SetText Screen.ActiveControl.Text
End If
End Sub

Private Sub 剪切_Click()
复制_Click
If TypeOf Screen.ActiveControl Is TextBox Then
Screen.ActiveControl.SelText = ""
ElseIf TypeOf Screen.ActiveControl Is ComboBox Then
Screen.ActiveControl.Text = ""
ElseIf TypeOf Screen.ActiveControl Is PictureBox Then
Screen.ActiveControl.Picture = LoadPicture()
ElseIf TypeOf Screen.ActiveControl Is ListBox Then
Screen.ActiveControl.RemoveItem Screen.ActiveControl.ListIndex
ElseIf TypeOf Screen.ActiveControl Is DBGrid Then
If DBGrid1.AllowUpdate = True Then Screen.ActiveControl.Text = ""
End If
End Sub

Private Sub 粘贴_Click()
If TypeOf Screen.ActiveControl Is TextBox Then
Screen.ActiveControl.SelText = Clipboard.GetText()
ElseIf TypeOf Screen.ActiveControl Is ComboBox Then
Screen.ActiveControl.Text = Clipboard.GetText()
ElseIf TypeOf Screen.ActiveControl Is PictureBox Then
Screen.ActiveControl.Text = Clipboard.GetData()
ElseIf TypeOf Screen.ActiveControl Is ListBox Then
Screen.ActiveControl.Text = Clipboard.GetText()
ElseIf TypeOf Screen.ActiveControl Is DBGrid Then
If DBGrid1.AllowUpdate = True Then Screen.ActiveControl.Text = Clipboard.GetText()
End If

richtextbox有复制粘贴方法!!!不用那么麻烦的

richtextbox有复制粘贴方法!!!不用那么麻烦的
-同意