GRID同行有相同字符串时高亮显示
如图所示:同一行中有相同的字符串时,就高亮显示,如第二行中有相同字符串"中_张三",就如图显示,可以是红色边框,也可以是红色背景,也可以是红色字体。
第四行中有相同字符串"汉_李四"如法炮制,在第四行第5列新填一个"汉_李四5",那么新添加的也要高亮显示,谢谢!
初始代码:
程序代码:
PUBLIC oform1 oform1=Newobject("Form1") oform1.Show RETURN DEFINE CLASS Form1 AS form Top = 0 Left = 0 Height = 256 Width = 561 DoCreate = .T. Caption = "Form1" Name = "Form1" ADD OBJECT Grid1 AS grid WITH ; DeleteMark = .F.,; Height = 200,; Left = 36,; RecordSource = "tt",; Top = 24,; Width = 504,; Name = "Grid1" PROCEDURE Load CLOSE ALL CREATE dbf tt(A c(12),B c(12),C c(12),D c(12),E C(12),F c(12)) INSERT INTO tt values("","","","","","") INSERT INTO tt values("中_张三1","","","","中_张三5","") INSERT INTO tt values("","","","","","") INSERT INTO tt values("","","","","","") INSERT INTO tt values("","汉_李四2","","汉_李四4","","") INSERT INTO tt values("","","","","","") GO top ENDPROC ENDDEFINE