如何让在picturesbox上的label透明

双击label下的图后,添加代码       

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);//picturesbox1就是label底下的那个图
                }
            }

        }

posted @ 2010-03-21 22:20  牛博  阅读(266)  评论(0编辑  收藏  举报