How can I prevent RichTextBox to accept objects? 
Author Message
 How can I prevent RichTextBox to accept objects?

Hi,

I have this problem with the RichTextBox control. I'm only using for text editing. The problem is that, for example, when I have an image in the clipboard and press Ctrl+V, the image is pasted in the RichTextBox. How can I prevent this?

--

Outlook Express Unofficial Site: http://www.*-*-*.com/
VB Open Source Site: http://www.*-*-*.com/



Tue, 29 Jan 2002 03:00:00 GMT  
 How can I prevent RichTextBox to accept objects?
This seems to work pretty good for me....

'============================
Private Sub RichTextBox1_Change()

   If RichTextBox1.OLEObjects.Count > 0 Then
      RichTextBox1.OLEObjects.Clear
      RichTextBox1.SetFocus
   End If

End Sub
'============================


Hi,

I have this problem with the RichTextBox control. I'm only using for text
editing. The problem is that, for example, when I have an image in the
clipboard and press Ctrl+V, the image is pasted in the RichTextBox. How can
I prevent this?

--

Outlook Express Unofficial Site: http://www.outlookexpress.go.ro
VB Open Source Site: http://open-source.home.ro



Tue, 29 Jan 2002 03:00:00 GMT  
 How can I prevent RichTextBox to accept objects?
Thanks Ken, I fixed that. However, I noticed another problem, somehow related to the previous one. When I have formatted text inside the clipboard and press Ctrl+V, the text is pasted with ITS font. I don't want this to happen because I'm using only one font for the entire document. Any idea on this problem?

--

Outlook Express Unofficial Site: http://www.outlookexpress.go.ro
VB Open Source Site: http://open-source.home.ro

Quote:

> This seems to work pretty good for me....

> '============================
> Private Sub RichTextBox1_Change()

>    If RichTextBox1.OLEObjects.Count > 0 Then
>       RichTextBox1.OLEObjects.Clear
>       RichTextBox1.SetFocus
>    End If

> End Sub
> '============================



> Hi,

> I have this problem with the RichTextBox control. I'm only using for text
> editing. The problem is that, for example, when I have an image in the
> clipboard and press Ctrl+V, the image is pasted in the RichTextBox. How can
> I prevent this?

> --

> Outlook Express Unofficial Site: http://www.outlookexpress.go.ro
> VB Open Source Site: http://open-source.home.ro



Thu, 31 Jan 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Canned objects and/or images

2. How to prevent inserting pictures into a RichTextBox

3. Howto Prevent EDITING contents of richtextbox, ALLOW selecting

4. RichTextBox, prevent scrolling

5. how to accept objects dropped from other apps in a VB app

6. active X control that could accept an recordset object

7. How do I create a canned form?

8. Canned AcctReceivable Module needed!

9. Canned pages....

10. Cans access2.0 engine access btrieve files?

11. Crystal Reports Canned Code

12. Switching from inhouse software to canned package.

 

 
Powered by phpBB® Forum Software