Georgio
Changing color of specific text in a table April 17, 2009 08:32PM |
sTblDetail = TABLE_ABSTRACT.Detail[nRowNum] // table data to color code WHILE sLineRead <> EOT n++ sLineRead = ExtractString(sTblDetail,n,CR) // ************************************** // valid data found, perform color coding // ************************************** IF sLineRead <> EOT THEN nStartPos = Position(TABLE_ABSTRACT.Detail[nRowNum],sLineRead) nEndPos = ((nStartPos + Length(sLineRead)) - 1) // check if uppercase sWorkString = Upper(sLineRead) // ********************************* // data is uppercase, color code red // ********************************* IF sWorkString = sLineRead THEN TABLE_ABSTRACT.Detail[nRowNum][[nStartPos TO nEndPos]]..Color = iDarkRed END END END
Al
Re: Changing color of specific text in a table April 18, 2009 10:14AM |
Moderator |
Piet van Zanten
Re: Changing color of specific text in a table April 18, 2009 01:30PM |
Georgio
Re: Changing color of specific text in a table April 19, 2009 01:06AM |
Quote
Piet van Zanten
Hi Georgio,
Looking at your code I understand that you have a multiline tablecell in which you want to color some parts red. This is not possible on normal text cells. If you change the column type to rtf you can change color using the rtfSelection function. Note that there's mention of a restriction in the Helpfile: rtfSelection can only be used on the table colum currently in edit. So I suppose you have to use returntocapture. Or wait for Windev 14.
Regards,
Piet