Alan Moseley IT Consultancy

Blog Entry

6/19/2008 - Changing the backcolor of an MDI parent form

I recently discovered that it is not possible (from the form properties window) to change the backcolor of an MDI parent form. This is due to the fact that this colour is controlled from the MDIClient control, which is not visible from the designer in Visual Studio. Therefore, if you need to change the colour I recommend taking the following steps:-

1. Change the backcolor property of your parent form to the required colour (even though this will not have an immediate effect).
2. In your form's Load event, include the following code:-
For Each ctrl as Control in Me.Controls
If TypeName(ctrl)="MdiClient" Then
End If

This method was adapted from the suggestion on Microsoft's knowledgebase article which, in my view, is slightly less intelligent.