Look at this sample:
public partial class Form1 : Form
{
private static string myString = null;
private const int MAX_TEXT = 5460;
public Form1()
{
InitializeComponent();
StringBuilder builder = new StringBuilder();
for (int i = 0; i < MAX_TEXT; i++)
{
builder.Append('a');
}
myString = builder.ToString();
this.Paint += Form1_Paint;
}
void Form1_Paint(object sender, PaintEventArgs e)
{
TextRenderer.DrawText(
e.Graphics,
myString,
this.Font,
new Point(10, 30),
Color.Black);
}
}
When I set the MAX_TEXT
to 5461, the string is not drawn. Do you know if the native mechanism has a limit to draw text, if/or I can setup the options to get it working?