Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / March 2008

Tip: Looking for answers? Try searching our database.

How to handle StringTrimming.EllipsisCharacter in Vista

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tom P. - 16 Mar 2008 06:12 GMT
I am doing some special painting in a listview control. I have gotten
the drawing of the string to cut off and ellipse correctly in XP but
in Vista the cutoff and ellipse never happen. I know it's possible,
Windows File Manager does it - when a filename is too long it'll
ellipse the missing part. My control just wraps it to the next line. I
can't find a way to either set the height of the ListViewItem or get
the ellipse to happen correctly. What is going on? I use the
DrawListViewSubItemEventArgs.Bounds to draw the string but all that
happens is the string wraps to the next line.

Any help would be great.

Tom P.
Tom P. - 17 Mar 2008 14:11 GMT
Thanks for the help, but I found what I needed.  Apparently, XP has a
default handling for FormatFlags but Vista does not, so they need to
be explicitly set like so:

sf.FormatFlags = StringFormatFlags.LineLimit |
StringFormatFlags.NoWrap;

This means only format as many lines as will fit in the rectangle, and
do not wordwrap (this forces the string out of the bounding rectangle
and thus causes an ellipsation).

Tom P.

> I am doing some special painting in a listview control. I have gotten
> the drawing of the string to cut off and ellipse correctly in XP but
[quoted text clipped - 9 lines]
>
> Tom P.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.