In case you can't create your own MessageBox with text area, I suggest trimming the wordy text. We can try two modes:
Trim on white space, e.g. My favorite wordy text is it into My favorite... in order to spare words
However, it's not always possible/reasonable. If we want, say, just 10 symbols in My favorite wordy text is it we'd rather not left My... but My favorit...
As a criterium for modes switching, let use a rule of thumb that the text trimmed should be at least of 2/3 of maximum possible length. Implementation:
public static string TrimWordyText(string source, int totalLength = 200) {
if (string.IsNullOrEmpty(source))
return source;
else if (source.Length <= totalLength)
return source;
// let's try trimming on white space (sparing mode)
int index = 0;
for (int i = 0; i <= totalLength; ++i) {
char ch = source[i];
if (char.IsWhiteSpace(ch))
index = i;
}
// can we save at least 2/3 of text by splitting on white space
if (index > totalLength * 2 / 3)
return source.Substring(0, index) + "...";
else
return source.Substring(0, totalLength) + "...";
}
....
// "My favorite..."
myTextBox.Text = TrimWordyText("My favorite wordy text is it", 15);
// "My favorit..."
myTextBox.Text = TrimWordyText("My favorite wordy text is it", 10);