我正在使用下面的代码来设置MdiParent窗体的背景图像,并且它运行良好,但是当我点击最大化按钮比BackgroundImage重复在右侧和底部边缘(即右侧和底侧图像部分重复),我该如何避免这种情况并正确显示图像?正确设置MdiParent背景图像
public Parent()
{
InitializeComponent();
foreach (Control ctl in this.Controls)
{
if (ctl is MdiClient)
{
ctl.BackgroundImage = Properties.Resources.bg;
ctl.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
break;
}
}
}
想你的解决方案还是同样的问题,坚持自己的 – Durga
@Durga更新我的回答 –