******************************************************************** * Description.......: myHeader.Definition * Calling Samples...: * Parameter List....: tcCaption * Created by........: Cetin Basoz & David Frankenbach * Modified by.......: Nadya Nosonovsky 05/25/2001 10:26:56 AM ******************************************************************** define class MyHeader as header mcArrowName = "" && name of the arrow used for all headers of the grid mlAscending = .f. && flag for sort order mlColumnMoved = .f. && flag indicating column was moved mnColumnOrder = 0 && original column order mlColumnSized = .f. && flag indicating column was resized mnColumnWidth = 0 && original size of column nOriginalForeColor = 0 && original ForeColor procedure init lparameters tcCaption local ix, lcProperty if vartype(m.tcCaption) # "C" ; or empty(m.tcCaption) tcCaption = this.caption endif this.caption = m.tcCaption this.alignment = 2 endproc procedure click local nTempCurRec, lcTagName with this if ! .mlColumnMoved and ! .mlColumnSized * sortable column that was clicked .mlAscending = ! .mlAscending thisform.lockscreen = .t. lcTagName=justext(.parent.controlsource) select (.parent.parent.recordsource) if tagno(m.lcTagName)> 0 .ForeColor=16711935 && Red if .mlAscending set order to tag (m.lcTagName) ; in (.parent.parent.recordsource) ascending else set order to tag (m.lcTagName) ; in (.parent.parent.recordsource) descending endif nTempCurRec = recno(.parent.parent.recordsource) .parent.parent.refresh if type('thisform.navstand.name')='C' thisform.navstand.lstOrders.value=m.lcTagName endif if between(m.nTempCurRec,1,reccount(.parent.parent.recordsource)) go m.nTempCurRec in (.parent.parent.recordsource) endif endif thisform.lockscreen = .f. endif endwith endproc procedure mousedown lparameters nButton, nShift, nXCoord, nYCoord with this * initialize items that will be tested in MouseUp .mnColumnOrder = this.parent.columnorder .mnColumnWidth = this.parent.width .nOriginalForeColor=.ForeColor endwith endproc procedure mouseup lparameters nButton, nShift, nXCoord, nYCoord with this * check to see if this was a resize or move .mlColumnMoved = ( this.parent.columnorder != .mnColumnOrder ) .mlColumnSized = ( this.parent.width != .mnColumnWidth ) * .ForeColor=.nOriginalForeColor endwith endproc procedure dblclick this.parent.parent.SetOrder(this.parent.controlsource) endproc enddefineNow, I'm trying to restore color back to original, if I click on another column header or another column. Could you please help me here?