473,799 Members | 2,929 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_Got Focus()
Me!lblData1.Bac kColor = 6993407
End Sub

Private Sub txtBox1Row1_Los tFocus()
Me!lblData1.Bac kColor = 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_Got Focus()
Me!lblData2.Bac kColor = 6993407
End Sub

Private Sub txtBox1Row2_Los tFocus()
Me!lblData2.Bac kColor = 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 1748
Are the names of your labels accurate? Is this being done in a continuous
fomr or datasheet?

"Marco Simone" <ma*********@ho tmail.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_Got Focus()
Me!lblData1.Bac kColor = 6993407
End Sub

Private Sub txtBox1Row1_Los tFocus()
Me!lblData1.Bac kColor = 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_Got Focus()
Me!lblData2.Bac kColor = 6993407
End Sub

Private Sub txtBox1Row2_Los tFocus()
Me!lblData2.Bac kColor = 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*********@ho tmail.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
2472
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" HTML----------- Form is ----> <form action="thanks.php" method="post" name="contact_form" id="contact_form"> Name -------> <input type="text" name="name" id="name" size="25"> Button sends code -----> <input type="button" value="Submit Form"
4
1833
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 used in the form detail is light, almost white. I can change the back color on the forms to match the controls, but on controls like tabs etc, it still looks goofy (since I can't change the backcolor on a tab control or button etc.). Is there...
16
7239
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
2231
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 handles inheritance. Environment: OS Name Microsoft Windows 2000 Professional Version 5.0.2195 Service Pack 4 Build 2195 Microsoft Visual C# .NET
10
3164
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 not using any upgrade tools, I'm just re-writing). I have be learning/testing .net with SDI type forms and now I'm actually working on the conversion, I'm starting to worry that VB.net
4
1822
by: tommaso.gastaldi | last post by:
I found useful to use transparent controls like: '---------------------------------------------------------------------------------- Public Class UserControlTransp Inherits System.Windows.Forms.UserControl #Region " Windows Form Designer generated code " .... #End Region
1
1878
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 = System.Drawing.SystemColors.Control; Then in my child form in the designer, I want to be able to enter "myColor" in the BackColor property.
22
2668
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(); document.photoUpload.submit();
5
27600
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 and select the first color. .ControlSouce =fRowNum(False) .Name = RowNum 2nd step: Add the following function to the form module: (for row numbers) Public Function fRowNum(Reset As Boolean) As Long Static I As Integer
0
9686
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9540
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10475
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10250
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10222
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9068
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3757
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.