How to get back to white form background when IsMdiContainer is true?
form becomes gray and i cant change it .
Me.BackColor.FromArgb(255, 255, 255) it doesnt work, it justs makes background white of the minimize and maximize buttons.
How to get back to white form background when IsMdiContainer is true?
form becomes gray and i cant change it .
Me.BackColor.FromArgb(255, 255, 255) it doesnt work, it justs makes background white of the minimize and maximize buttons.
For Each ctl As Control In Me.Controls
If TypeOf ctl Is MdiClient Then
ctl.BackColor = Me.BackColor
End If
Next ctl
Try This "this will change the color of your mdi container"
Public Sub MDIBGColor()
Dim ctl As Control
Dim ctlMDI As MdiClient
' Loop through all of the form's controls looking
' for the control of type MdiClient.
For Each ctl In Me.Controls
Try
' Attempt to cast the control to type MdiClient.
ctlMDI = CType(ctl, MdiClient)
' Set the BackColor of the MdiClient control.
ctlMDI.BackColor = Me.BackColor
Catch exc As InvalidCastException
' Catch and ignore the error if casting failed.
End Try
Next
End Sub
and call the sub on the form load event
#Region "Change Background Color of MDIParent : bgcolor()"
'to change the background color of mdiparent
Private Sub bgColor()
Dim child As Control
For Each child In Me.Controls
If TypeOf child Is MdiClient Then
child.BackColor = Color.CadetBlue
Exit For
End If
Next
child = Nothing
End Sub
use this in any click or form load