|
-
Mar 19th, 2007, 02:12 AM
#1
Thread Starter
Junior Member
cut,copy,paste,select all
ei..der can any body help me on to make the code for copy,cut,paste, and select all?
-
Mar 19th, 2007, 02:17 AM
#2
Re: cut,copy,paste,select all
COPY CODE
Code:
Clipboard.Clear
Clipboard.SetText Screen.ActiveControl.SelText
CUT CODE
Code:
Clipboard.Clear
Clipboard.SetText Screen.ActiveControl.SelText
Screen.ActiveControl.SelText = ""
PASTE CODE
Code:
Screen.ActiveControl.SelText = Clipboard.GetText()
-
Mar 19th, 2007, 02:22 AM
#3
Re: cut,copy,paste,select all
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
-
Mar 19th, 2007, 02:26 AM
#4
Re: cut,copy,paste,select all
Use Gavio's its much cleaner
-
Mar 19th, 2007, 02:35 AM
#5
Thread Starter
Junior Member
Re: cut,copy,paste,select all
what do you mean to RichTextBox1_MouseUp?
-
Mar 19th, 2007, 02:42 AM
#6
Re: cut,copy,paste,select all
 Originally Posted by Jose_JR.
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|