none
How do I add a RichTextBox control at design time? RRS feed

Answers

  • Hi Carlos,

    Welcome to the MSDN forum!

    Based on my understanding, RichTextControl needs a control as container to host it. Therefore, I'm afraid to say that the RichTextBox control can't be directly added onto a worksheet at the design time. You may refer to this thread: http://social.msdn.microsoft.com/Forums/eu/vsto/thread/c3e8dcce-c1db-4182-b17f-0c01ac87f608 


    To work around this issue, you can try the following steps:

    1. New a custom control in the VSTO project. It is named as UserControl1 by default.

    2. Drag a RichTextControl onto the surface of the custom control, and adjust the size as you like.

    3. Build the solution. Click on the Sheet1.cs and go to the design of Sheet1.cs, drag the UserControl1 from the Toolbox.

    You may set the RichTextControl's access level to public in the UserControl1.Designer.cs.

    Have a nice day!

    yoyo


    Yoyo Jiang[MSFT]
    MSDN Community Support | Feedback to us


    Wednesday, March 7, 2012 6:15 AM
    Moderator