locked
How to Show Formatted text in Tooltip? RRS feed

  • Question

  • Dear All,

    We need to support the functionality that user can copy the text from Word with formatting information (e.g. Font, Size etc.) and paste to the configuration of  one control. Then all these pasted information should be showed in Tooltip and should be the same as original in Word.

     

    We analyzed and found that probably use RichTextBox and TooltipService can solve this problem, but still need know the following two questions first:

    1)      How to just enable Paste function of RichTextBox? This RichTextBox is in configuration dialog of the control and just can accept the copied information from Word.

    2)      Can Tooltip embed the RichTextBox? Need just show the formatted information using RichTextBox in tooltip(read-only)

    Any idea about this? Thanks for your great help in advance,

     

    Yuanzi

    Thursday, November 10, 2011 4:58 AM

Answers

  • 1)      How to just enable Paste function of RichTextBox? This RichTextBox is in configuration dialog of the control and just can accept the copied information from Word.

    Silverlight only allows plain text from external application. Through COM automation you can probably access the system clipboard and get formatted text however this will be possible only in OOB apps with elevated trust and that on Windows only.

    2)      Can Tooltip embed the RichTextBox? Need just show the formatted information using RichTextBox in tooltip(read-only)

    The Silverlight tooltip can show any element, even complex UIs. In your case you would just set the tooltip's Content property to a RichTextBox you desire to show.

    Friday, November 11, 2011 6:08 AM