Valhalla Legends Forums Archive | .NET Platform | Richtext in a listviewitem

AuthorMessageTime
Imperceptus
I would like to put richtext in a listview item, any thoughts? google yielded nodda
May 11, 2009, 5:25 PM
Yegg
It should be possible with .NET. P
May 11, 2009, 9:54 PM
Quarantine
Yes, it's pretty easy if you're using WPF. If you're using WinForms, then I don't know.
May 12, 2009, 12:31 AM
Imperceptus
Well if its possible I will figure it out eventually, thanks =)
May 12, 2009, 2:05 AM
Quarantine
The XAML for a very simplistic WPF version would look like:

[code]
<ListView>
<ListViewItem>
<TextBlock>
<Span Foreground="Red">Hello</Span>
<Span Foreground="Blue" FontWeight="Medium">Hi</Span>
</TextBlock>
</ListViewItem>
</ListView>
[/code]

Due to WPF's rich content model, create these sort of composite controls is really easy.
May 12, 2009, 3:07 AM
Imperceptus
Sure looks easier then some of the crap ive tried so far.  I am tinkering with using a table layout panel, it works great but i think im breaking the scroll feature lol
May 12, 2009, 4:49 PM
Quarantine
[quote author=Imperceptus link=topic=17951.msg182713#msg182713 date=1242146974]
Sure looks easier then some of the crap ive tried so far.  I am tinkering with using a table layout panel, it works great but i think im breaking the scroll feature lol
[/quote]

Table layout panel? Are you speaking about WPF or WinForms?
May 12, 2009, 10:13 PM
Myndfyr
This wouldn't be implicitly possible without a lot of voodoo.  You might be able to set the parent window of the rich text box to the list view, but the list view itself is a window, its items are not.

Remember that Winforms is a wrapper around the Win32 API.
May 13, 2009, 4:09 AM

Search