首页 新闻 会员 周边

WM中,透明label问题?

0
悬赏园豆:50 [已关闭问题] 关闭于 2012-01-29 16:15

public Form1()
        {

    InitializeComponent();  
            this.pictureBox1.Paint += new PaintEventHandler(pictureBox1_Paint);  
  }
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 - this.pictureBox1.Left, L.Top - this.pictureBox1.Top);  
                }  
            }  
        } 

用此代码虽然在pictureBox上实现了label的透明,但是在程序运行后label上面的字却看不见了,请教各位大侠是怎么回事???

lingxiayidu的主页 lingxiayidu | 初学一级 | 园豆:31
提问于:2011-05-29 10:07
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册