Delphi DBGrid图显用法
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;
end;
Delphi DBGrid图显用法的更多相关文章
- Delphi中ClientDataSet的用法小结
Delphi中ClientDataSet的用法小结 TClientDataSet控件继承自TDataSet,其数据存储文件格式扩展名为 .cds,是基于文件型数据存储和操作的控件.该控件封装了对数据进 ...
- 转delphi中nil的用法
转自:http://blog.csdn.net/haiou327/article/details/6666124 delphi中nil的用法 和C++中的NULL一样的意思,指空值,它和0值不一样-- ...
- delphi字符串分隔函数用法实例
这篇文章主要介绍了delphi字符串分隔函数用法,通过自定义函数SeparateTerms2实现将字符串分割后存入字符串列表的功能,具有一定的实用价值,需要的朋友可以参考下 本文实例讲述了delphi ...
- delphi DBGrid简单自绘(字体颜色、背景等)
delphi DBGrid简单自绘(字体颜色.背景等) 从网上找的代码 应该是C#写的,其实delphi 的操作类似: 1 2 3 4 5 6 7 8 9 10 11 12 13 void __fa ...
- delphi DBgrid应用大全
Delphi 语言的数据库编程中,DBGrid 是显示数据的主要手段之一.但是 DBGrid 缺省的外观未免显得单调和缺乏创意.其实,我们完全可以在我们的程序中通过编程来达到美化DBGrid 外观的目 ...
- delphi dbgrid 修改、更新、删除
https://zhidao.baidu.com/question/580946797.html DELPHI 中,使用 dbgrid显示数据.窗体上放置三个按钮,caption分别为:修改.删除.更 ...
- tensorFlow 三种启动图的用法
tf.Session(),tf.InteractivesSession(),tf.train.Supervisor().managed_session() 用法的区别: tf.Session() 构 ...
- delphi assigned函数的用法
if not Assigned(Modeless) then Assigned()什么意思! assigned 是用来判断某一指针(pointer)或过程引用是否为nil(空),如果为空则返回假(fa ...
- Delphi DBGrid 实现复选框
1 在数据库对应的表中加入 bit 列验证是否被选中 然后dbgrid第一列的filedname是bit列 在DBgrid的onDrawColumnCell事件中写: procedure DBGri ...
随机推荐
- HTML canvas fillText()与measureText()方法
HTML5 canvas fillText() 方法 实例 使用 fillText(),在画布上写文本 "你好!word!" 和 "我是w3c": JavaSc ...
- Robot Framework自动化测试的应用
Robot Framework自动化测试的应用(一) 最近尝试用Robot Framework代替之前全部采用python实现测试case,开始对Robot Framework进行些了解学习. 1. ...
- spring_150906_sqlmapclientdaosupport_getSqlMapClientTemplate
添加到ibatis相关jar包! 实体类: package com.spring.model; public class DogPet { private int id; private String ...
- Codeforces Round #393 (Div. 2) (8VC Venture Cup 2017 - Final Round Div. 2 Edition) D - Travel Card
D - Travel Card 思路:dp,类似于单调队列优化. 其实可以写的更简单... #include<bits/stdc++.h> #define LL long long #de ...
- 一个完整的 JS 身份证校验代码
一个完整的 JS 身份证校验代码 身份证号码是由 18 位数字组成的,它们分别表示: (1) 前 1.2 位数字表示: 所在省份的代码; (2) 第 3.4 位数字表示: 所在城市的代码; (3) 第 ...
- java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES) 解决办法
一.背景 在Spark中,将DStream写入到MySQL出现错误:java.sql.SQLException: Access denied for user 'root'@'localhost' ( ...
- 洛谷P3066 [USACO12DEC] 逃跑的Barn [左偏树]
题目传送门 逃跑的Barn 题目描述 It's milking time at Farmer John's farm, but the cows have all run away! Farmer J ...
- UWP数据分享
前言 本文介绍如何在通用Windows平台(UWP)应用程序中支持共享合同.共享合同是一种在应用程序之间快速共享数据(如文本,链接,照片和视频)的简便方法.例如,用户可能想要使用社交网络应用与他们的朋 ...
- 由字符串反转(使用递归)引申出来一道Java面试题
如何面试一个从事编程工作的开发人员既困难又乏味,幸好还有很多值得参考的指南,比如:<Joel Guerilla Guide to interviewing>,但最后雇佣与否,还得由你自己决 ...
- Tomcat+Apache集群方案
韩梦飞沙 韩亚飞 313134555@qq.com yue31313 han_meng_fei_sha # environment slash for Windows(反斜杠代表Windows ...