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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Highlighting within Textboxes

Status
Not open for further replies.

Weeeegie

Technical User
Apr 13, 2006
1
GB
I've been working on programming a GUI for a piece of hardware, I'm currently doing the error rejection code. I have a textbox full of data (very long), and I can flag up individual lines, or character numbers when they are in error (i.e. not within the defined limits). I want to be able to somehow highlight these lines so it is easier to spot these lines (not necessarily contiguous).

Anyone got any idea how I can do this?
 
Rather than a text box, look into a RTB (Rich Text Box) control. The regular text box has trouble doing this but you can set multiple selections; highlights; different fonts; different colors, etc. in a RTB.

[small]No! No! You're not thinking ... you're only being logical.
- Neils Bohr[/small]
 
Or you could easily put a long rectangular box behind all your controls on the detail line, set it to background and transparent and use an IF statement on the details "on format" property to set the the box to background color red or something if a condition of one of the fields is met.
 
OR

If [SumOfSedatives] >= ([Text29] + [Text31]) And [SumOfSedatives] < ([Text29] + [Text31] + [Text31]) Then


Me.Detail.BackColor = 13434828

ElseIf [SumOfSedatives] >= ([Text29] + [Text31] + [Text31]) Then

Me.Detail.BackColor = 255
Else
Me.Detail.BackColor = 16777215

End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top