且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将背景图像添加到 MDI 表单

更新时间:2023-12-05 22:45:28

Winforms 不让您直接访问 MDI 客户端窗口.你必须找到它,就像这样:

Winforms doesn't give you direct access to the MDI client window. You have to find it, like this:

    protected override void OnLoad(EventArgs e) {
        foreach (Control ctl in this.Controls) {
            if (ctl is MdiClient) {
                ctl.BackgroundImage = Properties.Resources.SampleImage;
                break;
            }
        }
        base.OnLoad(e);
    }