c# 設定MdiClient窗體的背景圖片

DerekHan發表於2019-02-21

在窗體的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屬性就會起作用了。

相關文章