c#groupbox backcolor =透明不起作用

发布于 2025-01-29 07:33:49 字数 944 浏览 4 评论 0原文

嘿,我在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);

properties

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);

Properties

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

甚是思念 2025-02-05 07:33:50

您需要在整个组中使实体设置透明,以使其看起来相同。

You need to make the entities settings transparent in the whole group so it still looks the same.

千仐 2025-02-05 07:33:49

仅仅因为组框是透明的,并不意味着没有背部颜色了。

仍然有包含非透明背部颜色的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...)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文