Topic: .Net Windows Form, Drawing Text, Highlighted Pages that link to <a href="" title="Pages that link to Topic: .Net Windows Form, Drawing Text, Highlighted" rel="nofollow" >Topic: .Net Windows Form, Drawing Text, Highlighted\

Author Thread
Tyberius Prime
Maniac (V) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

IP logged posted posted 06-22-2006 08:56 Edit Quote

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

IP logged posted posted 06-25-2006 13:27 Edit Quote

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...

Maniac (V) Inmate

Insane since: Jul 2005

IP logged posted posted 06-27-2006 00:50 Edit Quote

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: Remember Me On This Computer
Your Text:
Options: Show Signature
Enable Slimies
Enable Linkwords

« BackwardsOnwards »

Show Forum Drop Down Menu