日期:2014-05-17 浏览次数:20914 次
label1.Parent = pictureBox1;
label1.Location = new Point(label1.Location.X - pictureBox1.Location.X, label1.Location.Y - pictureBox1.Location.Y);
label1.BackColor = Color.Transparent;
private void button1_Click(object sender, EventArgs e)
{
Point pt = pictureBox1.Parent.PointToScreen(pictureBox1.Location);
pt.Offset(30, 10);
Rectangle bounds = new Rectangle(pt, new Size(300, 50));
Font font = new Font("宋体", 18f);
DrawString("Hello, world!", bounds, font, Color.Red);
font.Dispose();
}
[DllImport("user32.dll")]
private static extern IntPtr GetDC(IntPtr hWnd);
[DllImport("user32.dll")]