1,第一种方法,设置背景透明色

 这种方法适合父容器就是窗体,控件直接再窗体中winform控件背景透明设置

 

 2,第二种方法,在窗体初始化的时候,设置父容器

这种方法适合控件在父容器(比如PictureBox)中

  public FrmLogin()
        {
            InitializeComponent();
            this.label1.Parent = this.pic_Main;//设置背景透明,这一句设置label在哪个panel里面
            this.label2.Parent = this.pic_Main;
            //this.label2.BackColor = System.Drawing.Color.Transparent;//label背景色透明,这里有父容器,在这里无效
            this.chk_UsePwd.Parent = this.pic_Main;
        }

  

相关文章:

  • 2022-12-23
  • 2021-08-28
  • 2022-01-06
  • 2022-12-23
  • 2021-12-27
  • 2021-11-09
  • 2021-06-13
  • 2021-10-06
猜你喜欢
  • 2022-12-23
  • 2021-12-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案