[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

Repost: DrawString and ellipsis problem ... please help

VisualHint

1/7/2005 1:05:00 PM

Hi,

I posted some time ago in December the following message and got no
answer. It is very important to me to solve this problem and I wish
that MVP people or anyone else could study with me this problem. It
could give birth to a wonderful custom control ;)

Thanks in advance, here it is :

I come from the MFC world and I can't get the same behaviour I add in
my old app with a new dotnet app written in C#.

I have a rectangle with a string inside and the user can drag the mouse
on the right side of the rectangle to shrink its width. While
shrinking, a string "abcd" is progressively displayed as:

abcd
abc...
ab...
a...
a..
a.

With the StringTrimming.EllipsisCharacter flag set in C# I get:

abcd
abc...
ab...
a...
abc
ab
a

It means that as soon as the "..." characters can't be displayed
completely, then the string is displayed again (at least the characters
that fit in the rectangle).
Any idea ?

Thanks a lot for your help

Herve

2 Answers

Bob Powell

1/7/2005 5:24:00 PM

0

GDI and GDI+ are two completely different systems. The ellipsis drawing are
different and so create a different effect.

If you need to have the exact same output as in your pervious app using GDI
then you must use interop to drive the GDI DrawText API.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Herve Bocuse" <cadilhac@gmail.com> wrote in message
news:1105103070.015927.239720@f14g2000cwb.googlegroups.com...
> Hi,
>
> I posted some time ago in December the following message and got no
> answer. It is very important to me to solve this problem and I wish
> that MVP people or anyone else could study with me this problem. It
> could give birth to a wonderful custom control ;)
>
> Thanks in advance, here it is :
>
> I come from the MFC world and I can't get the same behaviour I add in
> my old app with a new dotnet app written in C#.
>
> I have a rectangle with a string inside and the user can drag the mouse
> on the right side of the rectangle to shrink its width. While
> shrinking, a string "abcd" is progressively displayed as:
>
> abcd
> abc...
> ab...
> a...
> a..
> a.
>
> With the StringTrimming.EllipsisCharacter flag set in C# I get:
>
> abcd
> abc...
> ab...
> a...
> abc
> ab
> a
>
> It means that as soon as the "..." characters can't be displayed
> completely, then the string is displayed again (at least the characters
> that fit in the rectangle).
> Any idea ?
>
> Thanks a lot for your help
>
> Herve
>


VisualHint

1/7/2005 5:42:00 PM

0

Thanks a lot for this calrification Bob.