【发布时间】:2015-11-05 12:35:29
【问题描述】:
我有两种形式 a 和 b。表单 a 是主表单,在其中一个按钮单击事件表单 b 上显示为一个小窗口。在弹出窗口(表单 b)上,我有一个选择图像的选项。我需要做的是,当我点击弹出(表单 b)的保存按钮时,表单(主表单)的背景图像应设置为通过弹出表单(b)选择的图像。
我尝试了以下代码,但 this.Parent、this.Owner 都为弹出表单 (b) 返回 null。我已将表格 a 指定为 MDI。
this.Owner.BackgroundImage = pictureBoxBackground.Image;
this.Parent.BackgroundImage = pictureBoxBackground.Image;
【问题讨论】:
标签: c# winforms popup background-image mdiparent