Re: Repost: DrawString and ellipsis problem ... please help

From: Bob Powell [MVP] (bob_at__spamkiller_bobpowell.net)
Date: 01/07/05


Date: Fri, 7 Jan 2005 18:23:35 +0100

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/tipstricks.htm
Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm
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
> 


Relevant Pages

  • Re: GDI/Screen capture
    ... The standard GDI is the only way to go for now. ... Watch my blog and I'll post the ... Justin Rogers ... >>> lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: To display a picture
    ... The image is in TIFF format, ... ENM> GDI is very fast. ... Is your picture owner-drawn and how do you draw? ... // Create a string. ...
    (microsoft.public.vc.atl)
  • Re: Dynamically create Drawing.Pens color?
    ... Try Int32.Parse or TryParse to convert from string to a 32 bit value and then use that in the FromArgb. ... Find great Windows Forms articles in Windows Forms Tips and Tricks ... Answer those GDI+ questions with the GDI+ FAQ ... > Dim strFore As String ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: DrawString method - diagonal text?
    ... transform to change the angle of the string. ... Answer those GDI+ questions with the GDI+ FAQ ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: How to create a Serialnumber for App programmatically?
    ... > Find great Windows Forms articles in Windows Forms Tips and Tricks ... > Answer those GDI+ questions with the GDI+ FAQ ... >> Information as String. ...
    (microsoft.public.dotnet.languages.vb)