|
-
Jun 3rd, 2005, 08:36 AM
#1
Thread Starter
Hyperactive Member
Disable RichTextBox own paste code... help!
I am making my own notepad, and when i paste text to my RitchTextBox, the text comes with it's own format...
how can I prevet the font change ??
Thanks in advanced.
-
Jun 3rd, 2005, 08:51 AM
#2
Re: Disable RichTextBox own paste code... help!
In the Change event of the RTB, set the Font type (and/or Font Size) to whatever you want.
Any text pasted into will be in the font type/size format.
-
Jun 3rd, 2005, 08:55 AM
#3
Thread Starter
Hyperactive Member
Re: Disable RichTextBox own paste code... help!
when I change the font will it change the font of the text that I have pasted, or to the entire RTB ??
can you give me an example?
-
Jun 3rd, 2005, 08:59 AM
#4
Re: Disable RichTextBox own paste code... help!
 Originally Posted by Trojan
when I change the font will it change the font of the text that I have pasted, or to the entire RTB ??
can you give me an example?
It will change the font for the entire RTB, but that it what it sounds like you want to do.
Example: Your RTB standard font is MS Sans Serif. You paste something into the box that is Arial. Now, you have two different fonts types (as suggested by your original question). If, in the change event your set your font to MS Sans Serif, it will change the Arial that was pasted to that, but all the rest of the text will remain unchanged because it is already MS Sans Serif.
-
Jun 3rd, 2005, 09:05 AM
#5
Thread Starter
Hyperactive Member
Re: Disable RichTextBox own paste code... help!
mmm...
but you see when I do that, the entire rtb goes bad... it loses the format...
What I was thinking is to disable the built-in paste the RTB has, then all I have to do is to make my code put the text in the text box, without the any format set to it...
-
Jun 3rd, 2005, 09:12 AM
#6
Re: Disable RichTextBox own paste code... help!
 Originally Posted by Trojan
mmm...
but you see when I do that, the entire rtb goes bad... it loses the format...
What I was thinking is to disable the built-in paste the RTB has, then all I have to do is to make my code put the text in the text box, without the any format set to it...
Ok. So you have your own "paste" routine that you want to use instead Windows "paste"?
I'm not getting what you mean by "make my code put the text in..."
-
Jun 3rd, 2005, 09:15 AM
#7
Thread Starter
Hyperactive Member
Re: Disable RichTextBox own paste code... help!
 Originally Posted by Hack
Ok. So you have your own "paste" routine that you want to use instead Windows "paste"?
That is what I ment. that way I can control what format I Paste the text and control other stuff...
-
Jun 3rd, 2005, 09:47 AM
#8
Re: Disable RichTextBox own paste code... help!
 Originally Posted by Trojan
That is what I ment. that way I can control what format I Paste the text and control other stuff...
Well, the richtextbox, like the standard textbox, has its own right mouse click popup menu which you can replace with your own.
You could also clear the clipboard if they pressed Ctrl-V in your textbox so they couldn't use Windows to do the paste.
-
Jun 3rd, 2005, 09:58 AM
#9
Thread Starter
Hyperactive Member
Re: Disable RichTextBox own paste code... help!
well...
If I make a menu Item with shortcut "Ctrl+V" set it does not bypass the paste code of the windows...
I guess I need to find a solution in API...
-
Jun 3rd, 2005, 10:03 AM
#10
Re: Disable RichTextBox own paste code... help!
 Originally Posted by Trojan
well...
If I make a menu Item with shortcut "Ctrl+V" set it does not bypass the paste code of the windows...
I guess I need to find a solution in API...
You can capture Ctrl_V in the keydown event of your RTB
VB Code:
Private Sub RichTextBox1_KeyDown(KeyCode As Integer, Shift As Integer)
If (Shift And vbCtrlMask) = vbCtrlMask And KeyCode = vbKeyV Then
'do something else - clear the clipboard maybe
End If
End Sub
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
|