随笔 - 5  文章 - 109 评论 - 21 阅读 - 23万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

复制代码
代码
在pictureBox的Paint事件中写下如下代码

private void pictureBox1_Paint(object sender, PaintEventArgs e)

{

foreach (Control C in this.Controls)

{

if (C is Label)

{

Label L
= (Label)C;

L.Visible
= false;

e.Graphics.DrawString(L.Text, L.Font,
new

SolidBrush(L.ForeColor), L.Left
- pictureBox1.Left, L.Top - pictureBox1.Top);

}

}

}

或者在载入页面的时候在LOAD中写入下面代码:

pictureBox1.SendToBack();

label1.BackColor
= Color.Transparent;

label1.Parent
= pictureBox1;

label1.BringToFront();

复制代码

 

posted on   sn_wolf  阅读(905)  评论(0编辑  收藏  举报
努力加载评论中...
点击右上角即可分享
微信分享提示