diff --git a/MainUI/MainForm.cs b/MainUI/MainForm.cs index 90b0b9a35adcfbc538abd7d8f24c91b8c6f3d8a7..ff10c166b2326902da0b98cec909ea747be63c42 100644 --- a/MainUI/MainForm.cs +++ b/MainUI/MainForm.cs @@ -154,9 +154,19 @@ namespace Framework.MainUI AutoRunModule(); ApplicationLoader.RaiseMainFormShown(); - if (File.Exists("BackgroundImage.jpg")) + string backgroundImage = ""; + if (File.Exists(Path.Combine(ClientContext.ApplicationPath, "BackgroundImage.jpg"))) { - this.BackgroundImage = Image.FromFile("BackgroundImage.jpg"); + backgroundImage = Path.Combine(ClientContext.ApplicationPath, "BackgroundImage.jpg"); + } + else if (File.Exists(Path.Combine(ClientContext.ApplicationPath, "BackgroundImage.png"))) + { + backgroundImage = Path.Combine(ClientContext.ApplicationPath, "BackgroundImage.png"); + } + + if (!backgroundImage.IsNullOrEmpty()) + { + this.BackgroundImage = Image.FromFile(backgroundImage); this.BackgroundImageLayout = ImageLayout.Stretch; }