Let's say I have a Label
inside a Panel
. The text is going to be bigger than the Panel
sometimes, but not always. How would I figure out what part of the text I should at "..." in front of without hard-coding exactly how many characters it would take, because each character isnt the same size.
if (bigLabel.Width >= this.ClientRectangle.Width - 10) {
dotLabel.Location = new Point(this.ClientRectangle.Width - 10 - dotLabel.Width);
}
else {
dotLabel.Location = new Point(this.Width + 10, this.Height + 10);
}