You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
539 B
C#
22 lines
539 B
C#
5 years ago
|
Use Font from Form to paint string on a form
|
||
|
|
||
|
using System;
|
||
|
using System.Drawing;
|
||
|
using System.Windows.Forms;
|
||
|
|
||
|
class InheritHelloWorld : Form {
|
||
|
public static void Main() {
|
||
|
Application.Run(new InheritHelloWorld());
|
||
|
}
|
||
|
public InheritHelloWorld() {
|
||
|
Text = "Inherit " + Text;
|
||
|
}
|
||
|
protected override void OnPaint(PaintEventArgs pea) {
|
||
|
Graphics graphics = pea.Graphics;
|
||
|
|
||
|
graphics.DrawString("I Love Clementine",
|
||
|
Font, Brushes.Black, 0, 100);
|
||
|
}
|
||
|
}
|
||
|
|