Solved

Text Box - Rogue Backcolour

Posted on 1999-01-21
7
159 Views
Last Modified: 2010-05-03
I have a text box which appears in two slighly different hues, one where the text is entered and a lighter one where the box is still empty.

My PC shows the difference clearly whilst on my colleagues the difference is negligible and would only be seen if you were told to look out for it.

I dont want this colour difference - can any body tell me how to get rid of it.

When the text box is completely empty a band of this slight shading appears across its top line, the rest of the text box being a shade lighter.
0
Comment
Question by:Taranadilla
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 18

Expert Comment

by:mdougan
ID: 1469850
I don't know if this explains your problem or not, but here goes:

Depending on your color mode, some colors are made up of "dithered" colors.  If you go into Windows Paintbrush, for example and fill a large area with some of the pastel type colors, then look at it with the magnifying glass, you will see a checkerboard pattern.  While a textbox could show a dithered pattern in it's background, the system cannot use a dithered background as the fill behind individual letters -- such as the white space in the middle of this "O".  What the system does is select the closest possible non-dithered color to replace it.  There is nothing you can do, but ensure that you select a non-dithered color for all of your backgrounds.

That said.  Even with non-dithered colors, there are variations between different systems.  I don't know if it is because of the video cards, or the monitors, but sometimes I'll have a background color that is part of a graphic that is supposed to blend into the background color of a form, that looks great on most systems, but will show up differently on others.  I haven't found anything I can do about that.

MD
0
 

Author Comment

by:Taranadilla
ID: 1469851
I dont think this is the solution because the text box is actually shaded differently according to whether text has been entered.  If it was dithered it would still be the same throughout.  It isnt that it is different on my pc to anyone elses, but it is actually 2 shades within the same text box.


0
 
LVL 1

Expert Comment

by:rondeauj
ID: 1469852
if you are using the RGB() function to set your colors try using the vbconst for system colors.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:bear454
ID: 1469853
The behavior you describe is consistent with mdougan's comment & my own experience.  Set the background color to a basic vbconst color, such as vbWhite, or vbWindowBackgroud.

Jeez.
0
 
LVL 3

Accepted Solution

by:
HATCHET earned 100 total points
ID: 1469854
Taranadilla,

First and formost, make sure that you Right Click on your desktop and select Properties to bring up the display properties.  Go to the Settings tab and make sure you're Color palette is set to AT LEAST 16 Bit color on both yours and the other computers.  This will give you true colors, and not colors that are CLOSE to what they should be.

Second, go and click on all the TextBox controls that are in question and then go to the BackColor property and click then Down Arrow.  Set BackColor to "Window Background" under the System tab, or go to the Palette tab and set it to White... or any other color you like.

Third, go to the ForeColor property and click the Down Arror.  Set the ForeColor to "Window Text" or click the Palette tab and set it to Black... or any other color you like.

That should fix your problem.  Lemme know.

HATCHET
0
 
LVL 18

Expert Comment

by:mdougan
ID: 1469855
I thought you were saying that the background of the textbox where there is no text is a different shade from the background where there is text.  If so, this is exactly the type of behavior caused by having the textbox backcolor a dithered color.  

If, however, the textbox has different shades where there is no text, then you're right, it is not likely a dithering problem.
0
 

Author Comment

by:Taranadilla
ID: 1469856
You're right, using a palette colour removes the problem - only we're using a specially chosen set of colours and setting the RGB to that colour.  It must be something about the particular colour we are using.

Thanks for your help anyhow

T


0

Featured Post

Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question