Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/291.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将背景图像添加到MDI表单_C#_.net_Winforms - Fatal编程技术网

C# 将背景图像添加到MDI表单

C# 将背景图像添加到MDI表单,c#,.net,winforms,C#,.net,Winforms,我想请大家为我提供有关如何在winforms MDI应用程序中显示背景图像的信息 我理解通过MDI表格可以实现这一点 欢迎就如何开展这项工作提供任何意见 非常感谢 问候 bornagaindeveloper不允许您直接访问MDI客户端窗口。你必须找到它,就像这样: protected override void OnLoad(EventArgs e) { foreach (Control ctl in this.Controls) { if (ct

我想请大家为我提供有关如何在winforms MDI应用程序中显示背景图像的信息

我理解通过MDI表格可以实现这一点

欢迎就如何开展这项工作提供任何意见

非常感谢

问候
bornagaindeveloper不允许您直接访问MDI客户端窗口。你必须找到它,就像这样:

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

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

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

将其粘贴到MDI父窗体的类中。这与代码无关,Winforms故意抑制任何RTL窗口的背景图像。您必须订阅Paint方法。将其粘贴到MDI父窗体的类中。这与代码无关,Winforms会故意抑制任何RTL窗口的背景图像。您将不得不订阅绘画方法。