Is there a way to determine when the text is being wrapped on an UltraButton?
Hello rblanchard,
At that moment we have not such property but maybe one possible approach to determinate this condition with approx high accurancy could be if you are using the code below:
Graphics gr = ultraButton1.CreateGraphics();
SizeF sz = gr.MeasureString(ultraButton1.Text, ultraButton1.Font);
if (ultraButton1.Width <= (int)sz.Width + 10)
{
MessageBox.Show("The text is wrapped");
}
else
MessageBox.Show("The text is not wrapped");
Please let me know if you have any questions,
Regards
This seems to work just fine...Thanks.
I just need to figure out where to include as to adjust the Text to be Rotated 90 degress at runtime. I have logic in OnPaint that checks a Verticaltext property of my control and if not blank will rotate 90 degress. I added you sample logic to try and dynamically determine if the TEXT is wrapped and if so rotate. It appears this logic will get called over and over and over again.
Thanks for the sample.