Hello,
I have a question with a string trimming. I have to print a string in a rectangle. If the string exceeds the rectangle width then I need to trim the string. For this I am using this code:
My question is: how can I count the number of trims? I need this because my rowHeight variable has to be increased with each trimming in order to create the necessary space.
Later, I will use these values to draw a rectangle around the string.
Thx.
I have a question with a string trimming. I have to print a string in a rectangle. If the string exceeds the rectangle width then I need to trim the string. For this I am using this code:
Code:
Dim formatText As New StringFormat
formatText.Trimming = StringTrimming.Word
'Code that doesn't matter for my question
e.Graphics.DrawString(dataGridView1.Item(x, y).Value.ToString, Font, Brushes.Black, New Rectangle(pozX, pozY,fixedWidth, rowHeight), formatText)
Later, I will use these values to draw a rectangle around the string.
Thx.