|
-
Jan 16th, 2002, 11:56 PM
#1
Thread Starter
Addicted Member
Easy question.. please help!
I have a rich text box in my project and i want it to always use my standardized font, size, color ect...... but right now if you perform and Ctrl+C inside another rtf app like wordpad then ctrl+v into my app it shows up as it did inside wordpad. How do i prevent this from happening?
-
Jan 17th, 2002, 12:44 AM
#2
If you are only going to have one font, size and color, why not just use a standard textbox? That will eliminate problems like that.
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Jan 17th, 2002, 01:40 AM
#3
Thread Starter
Addicted Member
Well for one I can't have a character limit, and the program has syntax highlighting which does use multi color. I just don't want someone to be able to past in out of place text. I would prefer it best if I could prevent the Control-V keystrokes from being used inside the rtf box.
-
Jan 17th, 2002, 12:14 PM
#4
Thread Starter
Addicted Member
-
Jan 17th, 2002, 01:21 PM
#5
Thread Starter
Addicted Member
-
Jan 17th, 2002, 01:33 PM
#6
You have no control over the format of what is currently residing on the Clipboard (as a result of a copy - CTRL C)
Are you saving the contents of your richtextfile to a field in a backend Db?
-
Jan 17th, 2002, 03:41 PM
#7
Thread Starter
Addicted Member
Yes, and also into non-rtf printed text files. My question is not how to prevent ctrl + c from grabbing formmatting but how to prevent control + v from being used inside the rtf box. That way my menu Paste (short cut control + v ) will come into play and i can properly modify the text in the clipboard. How do i keep the rich text box from recieving control + v?
-
Jan 17th, 2002, 04:40 PM
#8
why don't you set the locked property to true?
why don't you set the locked property to true?
-
Jan 17th, 2002, 06:19 PM
#9
Thread Starter
Addicted Member
Because I do want the user to be able to modify the contents of the text box, but not be able to use ctrl + v.
-
Jan 17th, 2002, 06:30 PM
#10
Try this:
VB Code:
Private Sub RichTextBox1_KeyDown(KeyCode As Integer, Shift As Integer)
If (KeyCode = vbKeyInsert And Shift = vbShiftMask) Or _
(KeyCode = vbKeyV And Shift = vbCtrlMask) Then
RichTextBox1.SelText = Clipboard.GetText(vbCFText)
KeyCode = 0
End If
End Sub
-
Jan 17th, 2002, 10:28 PM
#11
Thread Starter
Addicted Member
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
|