change color for different controls

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi
Private Sub accessallcontrol(ByVal paramcontrol As Control)
Dim childcontrol As Control

With paramcontrol
'If CType(paramcontrol, Control) =
System.Windows.Forms.RadioButton Then

'End If

.BackColor = Color.NavajoWhite
For Each childcontrol In .Controls

accessallcontrol(childcontrol)

Next

End With


but i want to change only combo box color different
and label box different color...
where to change it
 
hi,

i have lot of controls on the form.
how to identify in the loop, that is combo or datagrid or textbox
the loop follows.

Private Sub accessallcontrol(ByVal paramcontrol As Control)
Dim childcontrol As Control
With paramcontrol
.BackColor = Color.NavajoWhite
For Each childcontrol In .Controls
accessallcontrol(childcontrol)

Next

End With
End Sub
 
Back
Top