1

OK, here's a problem i have. Searching the net did not help much.

In VB.net, you can right-align the text on a label. The label however has automatic word-wrap capabilities so it seems impossible to display a text in the label (of constant size) and always view the last part of the text.

I'm placing a folder name in the label and i'm always interested in seeing the last part of the text. As is now, if the path name is too large, i keep seeing the i.e. "C:\Documents and Settings" part, which i don't care to see. In VB6 when you right-align the text in a label, it displays the last part and if the text doesn't fit, it just cuts the text at the beginning. In VB.NET if the text is too large to fit in the label, word-wrap kicks in so you end up seeing the first part of the text only.

When using a textbox, even if it's right-aligned, if the text doesn't fit it just shows as much as possible from the START of the text (instead of from the END since it's right-aligned.)

Is there a way to achieve a similar behavior in VB.NET as in VB6's label?

N_A
  • 11
  • 2
  • possible duplicate of [C# WinForms - Smart TextBox Control to auto-Format Path length based on Textbox width](http://stackoverflow.com/questions/2397860/c-sharp-winforms-smart-textbox-control-to-auto-format-path-length-based-on-tex) – Hans Passant Nov 27 '12 at 11:27
  • Thanks for the link. I tried it and with a small modification (OnPaint -> Dim flags As TextFormatFlags = TextFormatFlags.Right) it works exactly as i wanted it to. Too bad though it doesn't work well with LinkLabel. Thanks. – N_A Nov 27 '12 at 11:46

0 Answers0