Why does text drawn on a panel disappear?

前端 未结 4 1776
说谎
说谎 2020-12-04 02:12

I\'m trying to draw a text on a panel(The panel has a background picture).

It works brilliant,but when I minimize and then maximize the application the text is gone.

4条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-04 02:58

    Just add a handler for the Paint event:

    private void panel1_Paint(object sender, PaintEventArgs e)
    {
        e.Graphics.DrawString("a", new Font("Tahoma", 5), Brushes.White, new PointF(1, 1));
    }
    

提交回复
热议问题