Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to colour half a text box

Status
Not open for further replies.

xwb

Programmer
Jul 11, 2002
6,828
GB
I'm writing an app where the user types a number and the program prints it out in words. Both the number and the words are then used to populate a form. Supposing the user types 123456, it would be one hundred and twenty three thousand four hundred and fifty six.

The problem is that the form only has 48 characters for the amount so the text would stop at four hund. What I'd like to do is display this in a text box that is 24 characters wide and highlight the first two lines in a different colour so the user has an idea of what will be printed and can adjust it accordingly.

That was one idea. Another one would be to only display the first 48 and let the user adjust what is there. I'm in two minds about this one.

Any suggestions on how I should proceed or how I can colour half a text box?
 
What about coloring the background, and making the text box transparent? I mean, you can't tell a text box (at least not in the regular properties) to only shade half.

The other thing you could do is *highlight* the characters in the text box; but you need to be careful with that, because if they don't realize it's highlighted, and press a key.... poof!



Just my 2¢
-Cole's Law: Shredded cabbage

--Greg
 
I managed to create 2 lines of 24 chars and set a non repeating background for the first two lines. That sort of looks OK. I left the text area as it was. Didn't look so good transparent.

Highlighting is a good idea but as you say, if they touch anything, it goes poof.

I guess I'll go with the non-repeating background. It is better than nothing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top