从面板更改 formwindows 背景色

发布于 2024-08-26 20:41:56 字数 174 浏览 0 评论 0原文

我有一个面板停靠在 Windows 窗体的右侧。我使用面板上的设置设置了颜色,但我想将主窗体(而不是面板)背景色更新为新设置。但是当我使用 me.backcolor = 设置时,它会更改面板背景色。

这也适用于带有 Visual Studios 2008 的 VB.net Windows 窗体,

谢谢

I have a panel that is docked to the right side of a windows form. I set a color with a setting on the panel but I want to then update the main form (not the panel) backcolor to the new setting. But when I use me.backcolor = setting it changes the panels backcolor.

This is also with VB.net windows forms with Visual Studios 2008

Thanks

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

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

发布评论

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

评论(1

睡美人的小仙女 2024-09-02 20:41:56

您必须使用以下方法更改父级的 BackColor

me.Parent.Backcolor = color;

You have to change the parent's BackColor using:

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