ei..der can any body help me on to make the code for copy,cut,paste, and select all?:wave:
Printable View
ei..der can any body help me on to make the code for copy,cut,paste, and select all?:wave:
COPY CODE
CUT CODECode:Clipboard.Clear
Clipboard.SetText Screen.ActiveControl.SelText
PASTE CODECode:Clipboard.Clear
Clipboard.SetText Screen.ActiveControl.SelText
Screen.ActiveControl.SelText = ""
Code:Screen.ActiveControl.SelText = Clipboard.GetText()
Code:Option Explicit
Private Sub RichTextBox1_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
If Button = vbRightButton Then
PopupMenu mnuRTB
End If
End Sub
Private Sub mnuCut_Click()
With RichTextBox1
Clipboard.SetText .SelText
.SelText = vbNullString
End With
End Sub
Private Sub mnuCopy_Click()
With RichTextBox1
Clipboard.SetText .SelText
End With
End Sub
Private Sub mnuPaste_Click()
With RichTextBox1
.SelText = Clipboard.GetText
End With
End Sub
Private Sub mnuSelectAll_Click()
With RichTextBox1
.SelStart = 0
.SelLength = Len(.Text)
End With
End Sub
Use Gavio's its much cleaner :)
what do you mean to RichTextBox1_MouseUp?:)
The right click on RichTextBox popup's the menu with Cut, Copy, Paste and Select All. If you want it on some other control, simply use it's MouseUp event.Quote:
Originally Posted by Jose_JR.