这个示例DisplayText是常见的Windows Forms。这次重写了OnPaint(),添加了成员字段,如下所示: private System.ComponentModel.Container components = null; private Brush blackBrush = Brushes.Black; private Brush blueBrush = Brushes.Blue; private Font haettenschweilerFont = new Font("Haettenschweiler", 12); private Font boldTimesFont = new Font("Times New Roman", 10, FontStyle.Bold); private Font italicCourierFont = new Font("Courier", 11, FontStyle.Italic | FontStyle.Underline); protec