Solved

Text Box - Rogue Backcolour

Posted on 1999-01-21
7
158 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
Independent Software Vendors: 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

734 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