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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top