J
John
I'm trying to use the DrawText() method to draw some very long string
text on the Panel with AutoScroll enabled. However, for some unknown
reasons, I could not trigger the ScrollBar to show up.
Here is the simplicied section of drawing code:
private void panel_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
panel.AutoScroll = true;
Font font = new System.Drawing.Font( "Arial", 18.0f );
SolidBrush brush = new System.Drawing.SolidBrush( Color.Black );
string s = "this is a very very long long long string string.";
e.Graphics.DrawString( s, font, brush, 0, 0);
}
The text did draw on the panel. However, this long string was
truncated without triggering the scrollBar.
What's wrong with my code?
Thank you for your help!
text on the Panel with AutoScroll enabled. However, for some unknown
reasons, I could not trigger the ScrollBar to show up.
Here is the simplicied section of drawing code:
private void panel_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
panel.AutoScroll = true;
Font font = new System.Drawing.Font( "Arial", 18.0f );
SolidBrush brush = new System.Drawing.SolidBrush( Color.Black );
string s = "this is a very very long long long string string.";
e.Graphics.DrawString( s, font, brush, 0, 0);
}
The text did draw on the panel. However, this long string was
truncated without triggering the scrollBar.
What's wrong with my code?
Thank you for your help!