Delphi DBGrid图显用法
来源:互联网 发布:javascript简易计算器 编辑:程序博客网 时间:2024/06/05 17:39
procedure TForm10.DBGrid1DrawColumnCell(Sender: TObject; const Rect: TRect;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var Im1: TBitmap;
staff_id: string;
begin
Im1:=TBitmap.Create;
if (dm.AQ_personal.RecordCount = 0) then exit;
if Column.Field = dm.AQ_personal.FindField('autoid') then
// if Column.Field = dm.AQ_personal.FindField('工号') then
begin
with DBGrid1.Canvas do
begin
Brush.Color:=clinfoBk;
FillRect(Rect);
staff_id:=dm.AQ_personal.FindField('staff_id').Asstring;
if ((dm.AQ_personal.FindField('work_type').Asstring)='离职类别')
then ImageList2.GetBitmap(0,Im1);
if ((dm.AQ_personal.FindField('work_type').Asstring)='试用期员工')
then ImageList2.GetBitmap(1,Im1);
if ((dm.AQ_personal.FindField('work_type').Asstring)='未填在离职')
then ImageList2.GetBitmap(2,Im1);
if ((dm.AQ_personal.FindField('work_type').Asstring)='在职类别')
then ImageList2.GetBitmap(3,Im1);
// TextOut(Rect.Right-2-DBGrid1.Canvas.TextWidth(staff_id),Rect.Top+1,staff_id);
// Draw(round((Rect.Left+Rect.Right-Im1.Width)/5),Rect.Top,Im1);
Draw(round((Rect.Left+Rect.Right-Im1.Width)/2),Rect.Top,Im1);
end;
end;
DataCol: Integer; Column: TColumn; State: TGridDrawState);
var Im1: TBitmap;
staff_id: string;
begin
Im1:=TBitmap.Create;
if (dm.AQ_personal.RecordCount = 0) then exit;
if Column.Field = dm.AQ_personal.FindField('autoid') then
// if Column.Field = dm.AQ_personal.FindField('工号') then
begin
with DBGrid1.Canvas do
begin
Brush.Color:=clinfoBk;
FillRect(Rect);
staff_id:=dm.AQ_personal.FindField('staff_id').Asstring;
if ((dm.AQ_personal.FindField('work_type').Asstring)='离职类别')
then ImageList2.GetBitmap(0,Im1);
if ((dm.AQ_personal.FindField('work_type').Asstring)='试用期员工')
then ImageList2.GetBitmap(1,Im1);
if ((dm.AQ_personal.FindField('work_type').Asstring)='未填在离职')
then ImageList2.GetBitmap(2,Im1);
if ((dm.AQ_personal.FindField('work_type').Asstring)='在职类别')
then ImageList2.GetBitmap(3,Im1);
// TextOut(Rect.Right-2-DBGrid1.Canvas.TextWidth(staff_id),Rect.Top+1,staff_id);
// Draw(round((Rect.Left+Rect.Right-Im1.Width)/5),Rect.Top,Im1);
Draw(round((Rect.Left+Rect.Right-Im1.Width)/2),Rect.Top,Im1);
end;
end;
end;
- Delphi DBGrid图显用法
- Delphi DBGrid图显用法
- delphi DBgrid 使用大全
- dbgrid使用大全(delphi)
- Delphi DBGrid总结
- Delphi DBGrid总结
- Delphi DBGrid 导出csv
- Delphi中的DBGrid控件
- Delphi DBGrid总结
- Delphi DBGrid重新排序
- Delphi DBGrid使用大全
- Delphi中的DBGrid控件
- 他山之石 网上Delphi DBGrid总结
- 【delphi】DBGrid中插入图片
- Delphi中DBGrid 应用全书
- Delphi跨进程访问DBGRID
- delphi DBgrid全文(转)
- Delphi调整Dbgrid列宽
- 难死人不偿命!苹果8大笔试题及答案
- 基于S5PV210的android系统移植日记。
- 114号和116号元素命名最终确定
- 秒杀多线程第八篇 经典线程同步 信号量Semaphore
- 程序员编程技术迅速提高的终极攻略
- Delphi DBGrid图显用法
- 30岁前不要去在乎的29件事
- Oracle对数据的导出和导入,建立用户,删除用户以及其下的所有表
- VC中 变量Control与Value的区别
- Android ArrayAdapter 详解
- 强内聚与松耦合
- Struts2.1.8 + jasperreports 3.7.1 + ireport 3.7.1
- openCV 2.4.1又出来了
- 程序员发展应该尽早明白13个道理