假设你的字段名叫MZ,类型为Integer,我来举一个例子。 把一切工作做好后,在DBGrid1的OnDrawDataCell事件中写下如下代码:If (Field.FieldName='MZ') And (Field.AsInteger=1) then DBGrid1.Canvas.TextRect(Rect,Rect.Left+2,Rect.Top+2,'男'); If (Field.FieldName='MZ') And (Field.AsInteger=2) then DBGrid1.Canvas.TextRect(Rect,Rect.Left+2,Rect.Top+2,'女');
把一切工作做好后,在DBGrid1的OnDrawDataCell事件中写下如下代码:If (Field.FieldName='MZ') And (Field.AsInteger=1) then
DBGrid1.Canvas.TextRect(Rect,Rect.Left+2,Rect.Top+2,'男');
If (Field.FieldName='MZ') And (Field.AsInteger=2) then
DBGrid1.Canvas.TextRect(Rect,Rect.Left+2,Rect.Top+2,'女');
如果是前者,清告诉我你是用ado来做的吗?[email protected]