RichTextBox

vb6 India
  • 19 years ago

    Can anybody explain me how to wrap the Rich TextBox(richtx32.ocx) control in another ActiveX control that does not expose the unsafe properties and methods. This wrapper should be marked as safe when it is packaged for distribution so that it works with the default browser security settings in I.E.


  • 19 years ago

    Can't you just hide the properties you don't want exposed in the UserControl? The browser/script won't be able to access the RichTextBox's Loadfile command if your usercontrol doesn't expose it.

  • 19 years ago

    The RichTextBox control is made unsafe for scripting since it can embedd potentially malicious OLE objects in it. I wanted to hide only these unsafe properties in the wrapping control. The problem I have while wrapping are:


    1. What should I do in my control for creating parameters which are displayed in <param> tag in an ASP or HTML page? For e.g. the TextRTF property of the RichTextBox control is displayed as a parameter in <param> tag when embedded in a HTML/ASP page. This is needed for initalizing the control with some string. The same thing I want in my control.


    2. Do I have to override all the properties of the RichTextBox in my control? Is there any way to map the RichTextBox properties to my control?

  • 19 years ago

    proy said:

    Quote:
    1. What should I do in my control for creating parameters which are displayed in <param> tag in an ASP or HTML page? For e.g. the TextRTF property of the RichTextBox control is displayed as a parameter in <param> tag when embedded in a HTML/ASP page. This is needed for initalizing the control with some string. The same thing I want in my control.

    hmm.... Well, if you expose the TextRTF property, and link it to the richtextbox's textrtf property, then the same thing should happen....
    Quote:

    2. Do I have to override all the properties of the RichTextBox in my control? Is there any way to map the RichTextBox properties to my control?

    The only properties made available are the ones that you write. TextRTF (or anything else) will not be available unless you write a property for it in your control...

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away.” - Antoine de Saint Exupéry