I need to change the backcolor or background image of the mdi parent in my application. I tried changing the background color or specifying a background image, this will not work. I also tried looping the controls in the form to get mdiclient and changing its inverse color, also a null result.
Maybe this will help? http://support.microsoft.com/kb/319465
Private ClientControl As MdiClient Public Sub New() InitializeComponent() ClientControl = Nothing For Each Ctl As Control In Me.Controls ClientControl = TryCast(Ctl, MdiClient) If ClientControl IsNot Nothing Then Exit For Next End Sub 'iN FORM LOAD ClientControl.BackColor = Color.Cyan
, , , BackgroundImage BackgroundImageLayout
MdiClient ctlMDI; foreach (Control ctl in this.Controls) { try { ctlMDI = (MdiClient)ctl; // Set the BackColor of the MdiClient control. ctlMDI.BackColor = Color.DarkRed; } catch (InvalidCastException exc) { // Catch and ignore the error if casting failed. } }
Try it, it works.
foreach (Control control in this.Controls) { // #2 MdiClient client = control as MdiClient; if (!(client == null)) { // #3 client.BackColor = GetYourColour(); // 4# break; } }
Source: https://habr.com/ru/post/1739087/More articles:Casting in MVVM Light CommandParameterValue - silverlightimport content into drupal - importWhy am I getting a “Day Too Big” error from Perl? - dateПочему я не могу пропустить свой json-объект с помощью jQuery? - jsonHow to access the main WPF Public Property form - c #Sophisticated user interface -> MVC template - c #WPF performance for a large number of items on the screen - performanceDatamatrix / QRCode online resource for encoding? - barcodeHow to use ORDER BY, LOWER in SQL SERVER 2008 with data other than unicode - sql-serverIs there a measuring equivalent in Silverlight xaml? - c #All Articles