|
-
Feb 7th, 2001, 04:33 PM
#1
Thread Starter
Hyperactive Member
anyone know the code for those using a rich textbox?
-
Feb 7th, 2001, 04:47 PM
#2
To use them, set the RichTextBox's AutoVerbMenu property to True.
-
Feb 7th, 2001, 10:11 PM
#3
Thread Starter
Hyperactive Member
yes but i have a menu with those options ... i want the code for them ...
-
Feb 7th, 2001, 11:16 PM
#4
Copy
Code:
Clipboard.Clear
Clipboard.SetText RichTextBox1.SelText
Cut
Code:
Clipboard.Clear
Clipboard.SetText RichTextBox1.SelText
RichTextBox1.SelText = ""
Paste
Code:
RichTextBox1.SelText = Clipboard.GetText()
Undo
Code:
Private Declare Function SendMessage _
Lib "user32" Alias "SendMessageA" (ByVal hwnd As _
Long, ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long
Private Const WM_UNDO = &H304
Private Sub Command1_Click()
SendMessage RichTextBox1.hwnd, WM_UNDO, 0, 0
End Sub
-
Feb 8th, 2001, 03:31 AM
#5
The RTB also has built in the shortcuts CTRL+(X, C, V, and Z) for this.
I noticed that if you use the Clipboard object in code to cut the selected text you can't undo that by pressing CTRL+Z.
What you can do is simply sending the right key combination to the RTB with the help of SendKeys.
Best regards
-
Feb 8th, 2001, 05:23 PM
#6
Thread Starter
Hyperactive Member
thanks matt ...
Joacim Andersson i first tried coding it that way ... i love sendkeys but one thing that makes me not use them is that for some reason it turns my NumLock light on and off ... don't know why but it just does ...
-
Feb 8th, 2001, 05:38 PM
#7
The following messages can also be sent
Code:
Private Const WM_CUT = &H300
Private Const WM_COPY = &H301
Private Const WM_PASTE = &H302
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
|