RichTextBox in a custom web control?

RichTextBox in a custom web control?

Post by Bob Sampso » Fri, 14 Mar 2003 01:57:10



In the Render function of my custom web control I have this:

System.Windows.Forms.RichTextBox MyRichTextbox = new
System.Windows.Forms.RichTextBox();

base.Controls.Add(MyRichTextbox);

And I get an error:
cannot convert from 'System.Windows.Forms.RichTextBox' to
'System.Web.UI.Control'

I understand the error, but this is even from a sample from the SDK. Any
ideas on how I get a RichTextBox onto my webpage? Thanks...

--
::BOB::
"Don't mess with the dead, boy, they have eerie powers."
- Homer Simpson

 
 
 

RichTextBox in a custom web control?

Post by Victor Garcia Aprea [MVP » Fri, 14 Mar 2003 03:48:56


Hi Bob,

Windows form controls are totally different from Web controls. You can't add
a windows form control like you're trying. You may want to look for a rich
text editor developed as a web server control.

--
Victor Garcia Aprea
Microsoft MVP | ASP.NET
To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
and not by private mail.
--
Learning ASP.NET, C# and VS.NET? Look at this book:
Beginning C# Web Applications with Visual Studio .NET
http://www.amazon.com/exec/obidos/ASIN/1861007329/laplatayacom


Quote:> In the Render function of my custom web control I have this:

> System.Windows.Forms.RichTextBox MyRichTextbox = new
> System.Windows.Forms.RichTextBox();

> base.Controls.Add(MyRichTextbox);

> And I get an error:
> cannot convert from 'System.Windows.Forms.RichTextBox' to
> 'System.Web.UI.Control'

> I understand the error, but this is even from a sample from the SDK. Any
> ideas on how I get a RichTextBox onto my webpage? Thanks...

> --
> ::BOB::
> "Don't mess with the dead, boy, they have eerie powers."
> - Homer Simpson


 
 
 

1. Custom RichTextBox Control Design Help.

I am trying to write a control derived from richtextbox and need to know
what is the best way to embed the words I wish to handle?
I am planning on handling the keyup for the enter and space key and go thru
code to do the work. This needless to say is my first nontrivial control.
So any help or ideas would be greatly appreciated. Also I would like all
the required code and resources be in one dll.

Thank You
Bo Hunter

2. 8.5 x long driver hack?

3. Problems adding a Web User Control to a Web Custom Control at run time

4. top 10 needed new comp or sci newsgroups

5. Web User Controls, Web Custom Controls and events

6. Please help with research

7. Convert a Web User Control to a Web Custom Control

8. 2D Fourier transform of 2 pulses

9. How to Dynamically create Web User Controls and Web Custom Control?

10. Custom control vs User control / Sizing controls within custom control

11. .NET Add-ins in Excel do not show up in Add-ins

12. is RichTextBox control there in vb.net 3.5 web application

13. How do I catching errors from custom web controls on web form???