Can anybody help me with this one.
On a standard form, I have a label that I dynamically change & refresh the .Caption value depending on some selected criteria from a multi-selection grid. The .Caption value will be a comma-delimited character string of abbreviated codes - typically 2-3 characters each.
e.g., "Tst2, BR, M, CTH".
The label size in pixels is 164 x 17, and uses MS Sans Serif (9) font.
My problem arises if the user has selected more codes than will display in this fixed-length label.
I want to be able to determine whether or not the character string will fit in the 164 display width (based on the actual characters in the string and the fact that MS Sans Serif is a variable-width character font), and, if it won't fit, I want to truncate the string at just the correct character position and add a continuation ellipsis (...) at the end so that the user knows that there are additional codes that have been selected.
Any ideas here?
On a standard form, I have a label that I dynamically change & refresh the .Caption value depending on some selected criteria from a multi-selection grid. The .Caption value will be a comma-delimited character string of abbreviated codes - typically 2-3 characters each.
e.g., "Tst2, BR, M, CTH".
The label size in pixels is 164 x 17, and uses MS Sans Serif (9) font.
My problem arises if the user has selected more codes than will display in this fixed-length label.
I want to be able to determine whether or not the character string will fit in the 164 display width (based on the actual characters in the string and the fact that MS Sans Serif is a variable-width character font), and, if it won't fit, I want to truncate the string at just the correct character position and add a continuation ellipsis (...) at the end so that the user knows that there are additional codes that have been selected.
Any ideas here?