c#groupbox backcolor =透明不起作用
嘿,我在C#中创建了一个表格。我制作了一些组盒,并将其后色设置为透明,但仍然有一个后色。这里有人可以帮助我解决这个问题,以便我可以使组盒透明?
this.groupBox1.BackColor = System.Drawing.Color.Transparent;
this.groupBox1.Controls.Add(this.BTN_Unlockall);
this.groupBox1.Controls.Add(this.pictureBox4);
this.groupBox1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Bold);
this.groupBox1.ForeColor = System.Drawing.Color.White;
this.groupBox1.Location = new System.Drawing.Point(12, 47);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(328, 95);
this.groupBox1.TabIndex = 336;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Tools";
this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter);
Hey I have created a form in c#. I made some groupboxes and set their BackColor to transparent, but there is still a backcolor. Anyone here who can help me solve this so I can make the groupboxes transparent?
this.groupBox1.BackColor = System.Drawing.Color.Transparent;
this.groupBox1.Controls.Add(this.BTN_Unlockall);
this.groupBox1.Controls.Add(this.pictureBox4);
this.groupBox1.Font = new System.Drawing.Font("Microsoft YaHei UI", 9F, System.Drawing.FontStyle.Bold);
this.groupBox1.ForeColor = System.Drawing.Color.White;
this.groupBox1.Location = new System.Drawing.Point(12, 47);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(328, 95);
this.groupBox1.TabIndex = 336;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Tools";
this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要在整个组中使实体设置透明,以使其看起来相同。
You need to make the entities settings transparent in the whole group so it still looks the same.
仅仅因为组框是透明的,并不意味着没有背部颜色了。
仍然有包含非透明背部颜色的groupbox的父容器元素的背面颜色。将元素的背颜色设置为透明意味着使其相对于其直接父容器元素透明。 (然后还可以考虑父母容器的父容器。
Just because the groupbox is transparent doesn't mean there is no back color anymore.
There is still the back color of the parent container element containing the groupbox that might have a non-transparent back color. Setting the back color of an element as transparent means making it transparent with respect to its immediate parent container element. (And then there might also the parent container of the parent container to be considered. And the parent of the parent of the parent container, etc...)