473,513 Members | 2,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form Controls Colors

Hi,

I have form with few rows of text boxes and labels. I tried to change colors
of labels, when txtBox gets focus, with code.

Private Sub txtBox1Row1_GotFocus()
Me!lblData1.BackColor = 6993407
End Sub

Private Sub txtBox1Row1_LostFocus()
Me!lblData1.BackColor = 16777215
End Sub

I have 3 text boxes in every row, so I put this code in every text box. This
works in one row.
This changing of colors dont work when try to implement this code in next
row of text boxes.

Private Sub txtBox1Row2_GotFocus()
Me!lblData2.BackColor = 6993407
End Sub

Private Sub txtBox1Row2_LostFocus()
Me!lblData2.BackColor = 16777215
End Sub

When moving focus to next row, label in next row doesn't change color.

Any help is greatly appreciated.

Thanks, Marco
Nov 12 '05 #1
3 1734
Are the names of your labels accurate? Is this being done in a continuous
fomr or datasheet?

"Marco Simone" <ma*********@hotmail.com> wrote in message
news:c0**********@ls219.htnet.hr...
Hi,

I have form with few rows of text boxes and labels. I tried to change colors of labels, when txtBox gets focus, with code.

Private Sub txtBox1Row1_GotFocus()
Me!lblData1.BackColor = 6993407
End Sub

Private Sub txtBox1Row1_LostFocus()
Me!lblData1.BackColor = 16777215
End Sub

I have 3 text boxes in every row, so I put this code in every text box. This works in one row.
This changing of colors dont work when try to implement this code in next
row of text boxes.

Private Sub txtBox1Row2_GotFocus()
Me!lblData2.BackColor = 6993407
End Sub

Private Sub txtBox1Row2_LostFocus()
Me!lblData2.BackColor = 16777215
End Sub

When moving focus to next row, label in next row doesn't change color.

Any help is greatly appreciated.

Thanks, Marco

Nov 12 '05 #2
> Are the names of your labels accurate? Is this being done in a continuous
fomr or datasheet?


Yes, label names are correct. This is on single form view.
Nov 12 '05 #3
Thanks for your help,

Somehow I manage this to work. I just tried with format painter on label
which changes colour to another label. Now it works.

Marco

"Marco Simone" <ma*********@hotmail.com> wrote in message
news:c0**********@ls219.htnet.hr...
Are the names of your labels accurate? Is this being done in a continuous fomr or datasheet?


Yes, label names are correct. This is on single form view.

Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
2437
by: CJ | last post by:
Why won't this work? I am passing the name of the form (I have two that use this validation script) but I keep getting an error. Error reads: "document.which_form.name is null or not an object" ...
4
1819
by: Jozef | last post by:
Hello, I have forms in my database that use grey as the back color. When I convert them to XP, They all look goofy. The grey becomes two tone. The grey used in the controls are dark, the grey...
16
7192
by: TD | last post by:
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl
0
2211
by: Frnak McKenney | last post by:
I'm running into problems with VisualStudio.NET2003 and Windows Forms inheritance. It _feels_ like a bug, but it could just as well be a misunderstanding on my part regarding how the VS Designer...
10
3117
by: Sarah Smith | last post by:
Hello, I am a bit of a newbie to VB.NET, but not totally new. I took the plunge recently and decided (along with my colleagues), to try to convert/port a VB6 client/server app to .Net. (I'm...
4
1803
by: tommaso.gastaldi | last post by:
I found useful to use transparent controls like: '---------------------------------------------------------------------------------- Public Class UserControlTransp Inherits...
1
1866
by: Demi | last post by:
I want to be able to define standard colors in a base form, then have child forms use those values instead of standard colors. Ex in my base form I want to do this: Color myColor =...
22
2621
by: Victor | last post by:
Hi everybody! I am experiencing a strange - at least for me - phenomen. I have a func containing the following code : alert (document.forms.elements.value); // document.forms.submit();...
5
27531
by: Michael R | last post by:
Searching the net I've found a simple technique to add row numbers and alternate colors (for the even and the uneven row) to a continuous form. 1st step: Create a textbox, send it to background...
0
7257
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7157
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7521
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5084
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3232
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3221
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1591
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.