在窗體的InitializeComponent();方法后面添加下面的代碼。
MdiClient MC = new MdiClient();
MC.Name = "MdiClientForm";
MC.Dock = DockStyle.Fill;
MC.BackgroundImageLayout = ImageLayout.Stretch;這句其實不會起作用的,寫在這里只是說明一下。
MC.BackgroundImage= global::DispenserAutomatic.Properties.Resources.bg;
要想使用BackgroundImageLayout屬性,只要設置主窗體的BackgroundImageLayout屬性就會起作用了。
