Rob,
This is very simple to do in VB, be aware that some controls don't have a
backcolor.
\\\
Private Sub MyControls_GotFocus(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles ComboBox1.GotFocus, ListBox1.GotFocus, TextBox1.GotFocus
DirectCast(sender, Control).BackColor = Color.DarkRed
End Sub
Private Sub MyControls_LostFocus(ByVal sender As Object, _
ByVal e As System.EventArgs) _
Handles ComboBox1.LostFocus, ListBox1.LostFocus,
TextBox1.LostFocus
DirectCast(sender, Control).BackColor = Color.DarkGreen
End Sub
///
Did you know that a better newsgroup to ask this kind of question for VB is
microsoft.public.dotnet.languages.vb
Succes
Cor
"Rob" <ROb@xxxxxx> schreef in bericht
news:efhaA%23jzIHA.3972@xxxxxx
> Hi,
> I'am working with vb2005 and it's an ADO application based on an access
> database.
>
> i'am still have problems to get the backcolor of an control in a different
> color if it has the focus.
> I am searching for a routine which automacticly highligt the control
> (textbox, cbo, groupbox) if he is focused instead to program each control
> separatly by gotfocus and lostfocus. (Me.BackColor = Color.YellowGreen)
>
> IS there somebody who can help me through this problem ??
>
> regard, rob
>
>
>