How to write a string on a form using GDI+

Posted by Ddd under Windows Forms category on | Points: 40 | Views : 2482
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication2
public partial class Form3 : Form
public Form3()

private void Form3_Paint(object sender, PaintEventArgs e)

Graphics g = this.CreateGraphics();

// Create coordinates for drawing the string (xand y)
PointF p = new PointF(100, 150);

g.DrawString("CSHARP", this.Font, Brushes.Blue, p);


Comments or Responses

Login to post response