1

次のコードは何も描画していません。

void Form3_Paint(object sender, PaintEventArgs e)
{
      string text = new string('m', 3000);
      TextRenderer.DrawText(
          e.Graphics,
          text,
          this.Font,
          new Point(10, 10),
          Color.Black,
          Color.Transparent);
}

文字列が長すぎるようです。文字列の長さを 2000 に変更すると、動作します (私は SegoeUI 9 を使用しています) フォント。

これに対する回避策を知っていますか?

4

1 に答える 1