动态生成的 DBGridEh, 如何写OnDrawColumCell事件. ( 积分: 0 )

  • 主题发起人 主题发起人 fjfztv
  • 开始时间 开始时间
F

fjfztv

Unregistered / Unconfirmed
GUEST, unregistred user!
procedure&nbsp;DrawColumnCellOfBuy(Sender:&nbsp;TObject;&nbsp;const&nbsp;Rect:&nbsp;TRect;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataCol:&nbsp;Integer;&nbsp;Column:&nbsp;TColumnEh;&nbsp;State:&nbsp;TGridDrawState);<br><br>&nbsp;DBGridEh.OnDrawColumnCell&nbsp;:=&nbsp;DrawColumnCellOfBuy;<br><br>不知道是哪里出错,总是提示:Incompatible&nbsp;types:&nbsp;'method&nbsp;pointer&nbsp;and&nbsp;regular&nbsp;procedure'&nbsp;。
 
procedure&nbsp;DrawColumnCellOfBuy(Sender:&nbsp;TObject;&nbsp;const&nbsp;Rect:&nbsp;TRect;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataCol:&nbsp;Integer;&nbsp;Column:&nbsp;TColumnEh;&nbsp;State:&nbsp;TGridDrawState);<br>不是成员方法
 
那这个方法要这么写,才可以成功~&nbsp;谢谢
 
procedure&nbsp;TForm1.DrawColumnCellOfBuy(Sender:&nbsp;TObject;&nbsp;const&nbsp;Rect:&nbsp;TRect;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DataCol:&nbsp;Integer;&nbsp;Column:&nbsp;TColumnEh;&nbsp;State:&nbsp;TGridDrawState);
 
OK了,谢谢~!
 
后退
顶部