프로그램/C#

C# 폼 투명하게 하기

알 수 없는 사용자 2013. 3. 12. 00:46



private void Form1_Load(object sender, EventArgs e)
        {
            this.Visible = false;
            this.ShowInTaskbar = false;
        }
 ==========================
  label7.Parent = progressBar1;
 
transparent
 

 폼로드시 해당 함수호출
        private void WorkUnitSeting_Load(object sender, EventArgs e)
        {
            //배경이 있는 컨트롤 투명처리
            SetCtlsArgb();
        }
 
        /// 
        /// 배경이 있는 컨트롤 투명처리
        /// 
        private void SetCtlsArgb()
        {
            Control.ControlCollection coll = this.Controls;
            foreach (Control c in coll)
            {
                if (c != null)
                {
                    // CheckBox , Lable인 컨트롤의 경우 투명하게 처리합니다.
                    if (c.GetType() == typeof(CheckBox) || c.GetType() == typeof(Label))
                    {
                        c.BackColor = Color.FromArgb(0, 0, 0, 0);
                    }
 
                }
 
            }
        }