[求助]请教关于c# 中的paint事件~~
各位高手 !为何我用paint事件在窗体上画图形的时候窗体上没有任何显示?请高手赐教~~
看看这个:
protected override void OnPaint(PaintEventArgs e)
{
String drawString = "Sample Text";
Font drawFont = new Font("Arial", 16);
SolidBrush drawBrush = new SolidBrush(Color.Black);
float x = 150.0F;
float y = 50.0F;
StringFormat drawFormat = new StringFormat();
drawFormat.FormatFlags = StringFormatFlags.DirectionVertical;
e.Graphics.DrawString(drawString, drawFont, drawBrush, x, y, drawFormat);
base.OnPaint (e);
}