将背景图像添加到 MDI 表单 [英] Adding background image to MDI form

查看:31
本文介绍了将背景图像添加到 MDI 表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想请人们为我提供有关如何在 winforms MDI 应用程序中显示背景图像的意见.

I would like to request people to give me inputs on how to show a background image in a winforms MDI Application.

我知道通过 MDI 表格是可能的.

I understand that it is possible through the MDI form.

欢迎提供有关如何进行的任何意见.

Any inputs on how to go about it would be welcome.

非常感谢

问候新生开发者

推荐答案

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

这篇关于将背景图像添加到 MDI 表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆