使用单一设置在所有窗体中设置相同的背景 [英] Set the same background in all windows forms with a single setting

查看:22
本文介绍了使用单一设置在所有窗体中设置相同的背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一个 C# 项目中有 40 个窗体.我必须在所有形式中设置相同的背景.在单个设置中是否有任何选项或设置可以做到这一点?

i have 40 windows forms in a C# Project. i have to set the same background in all forms. is any option or settings to do that in a single settings?

推荐答案

您可以创建基本表单并为其设置背景,其他表单也可以从基本表单继承.

You can create base form and set the background for it and other form inherit from the base form.

class baseForm: Form {
    void base() {
        this.BackColor = //set here
    }
}

class YourForm : baseForm {

}

这篇关于使用单一设置在所有窗体中设置相同的背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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