Results 1 to 5 of 5

Thread: [RESOLVED] Displaying RTF in list, what control can I use?

  1. #1

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Resolved [RESOLVED] Displaying RTF in list, what control can I use?

    I need to be able to display a list but the items are in RTF and I want to be able to display the formatted text, what are my options to be able to do this?
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Displaying RTF in list, what control can I use?

    RichTextBox. One of the aims of WPF was to make controls composable, meaning that one control can appear inside another. You can put a RichTextBox inside other controls, e.g. ListView, no problem. Here's an example of a TextBox inside a ListView:

    http://social.msdn.microsoft.com/For...0-da5ee6330da6

    A RichTextBox would be similar. You can do similar things with other controls, e.g. ListBox.

  3. #3

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: Displaying RTF in list, what control can I use?

    Yes, I was hoping it was easy like that but Richtextbox has no immediate property that I can bind into to make it work just like in TextBlock. Will try searching on how to make such property.
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: Displaying RTF in list, what control can I use?

    Quote Originally Posted by dee-u View Post
    Yes, I was hoping it was easy like that but Richtextbox has no immediate property that I can bind into to make it work just like in TextBlock. Will try searching on how to make such property.
    If that is the case then you could probably inherit the RichTextBox class and add a property yourself. Internally, that property can access the Document and use a TextRange or whatever's required.

  5. #5

    Thread Starter
    Software Carpenter dee-u's Avatar
    Join Date
    Feb 2005
    Location
    Pinas
    Posts
    11,123

    Re: [RESOLVED] Displaying RTF in list, what control can I use?

    The Richtextbox in WPF Toolkit has a Text property I can bind into. =)
    Regards,


    As a gesture of gratitude please consider rating helpful posts. c",)

    Some stuffs: Mouse Hotkey | Compress file using SQL Server! | WPF - Rounded Combobox | WPF - Notify Icon and Balloon | NetVerser - a WPF chatting system

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width