Jump to content

Truncating caption in TUniLabel


Recommended Posts



In my project i am using TUniLabel to display filenames, which can get quite long. If the filename is too long to fit into the space allocated at design time, i would like the TUniLabel to simply truncate the remaining characters in the filename. Instead the TUniLabel seems to expand either horizontally or vertically (depending on the value of the AutoSize property) so as to display the full filename. This obscures other controls on the form. As a workaround i tried placing a TUniPanel with the desired dimensions, and then placing a TUniLabel with Align=alClient on top of that. This does prevent the filename from obscuring other controls. However if the filename contains a hypen (-) or a space ( ) -- e.g. "3298_4.AB-DocumentName_2015.pdf" -- the rest of the filename wraps and the user only gets to see "3298_4.AB-".


Does anybody have any suggestions as to how to implement this?


Many thanks,


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...