Topic: .Net Windows Form, Drawing Text, Highlighted (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=28111" title="Pages that link to Topic: .Net Windows Form, Drawing Text, Highlighted (Page 1 of 1)" rel="nofollow" >Topic: .Net Windows Form, Drawing Text, Highlighted <span class="small">(Page 1 of 1)</span>\

 
Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-22-2006 08:56

Phew... I spend most of yesterday creating my own Treeview Control
that supports multi lined and wrapped text.


Now, I've finished the basic treeview control, works great, is faster than
.Net's own Treeview (which is just a wrapper for the window treeview)
allows full color customization etc...

But I need to have pieces of text highlighted. Think links .

So far I've been using TextRenderer (After many many tries with DrawString and MeasureCharacterRanges),
but alas, I can't figure out a reliably way to highlight specific parts of the text (overpainting, painting piece
by piece is a pain with the word wrapping...).

Does any of you have any pointers? I've googled my keyboard blank, but can't find anything.
(I'm not that fixed on TextRenderer - if you know a decent text rendering lib for .Net/c# I want to know).

You guys are my last hope...

So long,

->Tyberius Prime

Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 06-25-2006 13:27

Well, I found UspLib, a C Wrapper for Uniscribe,
which seems to do just that, with just about any unicode text.

But since this is a hobby project, I ended up just splitting on lines and spaces, and drawing each word by itself...

_Mauro
Maniac (V) Inmate

From:
Insane since: Jul 2005

posted posted 06-27-2006 00:50

Thks for sharing TP, sorry, but C#, while a -pale- copy of Java, is not my cup of tea at all: saw your question, spent some time searching,
didn't come up with anything that fits the bill correctly.

One more reason why I find C# sucks: Java have set a standard for documentation, javadoc, which transposes the java API
into a bunch of web pages. Therefore, code comments, if well formatted, can automatically be turned into such a doclet,
and when you wonder about.. say the return type of a method (what's the FileInputStream object this method returns? for example...)

You just have to follow the linkie.

In spite of the market trend towards the weak and pathetic C# and the "new" MS "ripped" and crippled technology,
in spite of my daily usage of Windows for private purposes, when it comes to business and development, I am not the person to ask
about frail things MS calls "technology". I am more into stuff that lasts.



Post Reply
 
Your User Name:
Your Password:
Login Options:
 
Your Text:
Loading...
Options:


« BackwardsOnwards »

Show Forum Drop Down Menu