delphi---EHlib第三方插件----TDBGridEH,TDBNumberEditEh,TDBComboBoxEh
一、TDBGridEH
1、多选 行
options->dgMultiSelect
2、列字体改变颜色,OnDrawColumnCell写下方法。
if Column.FieldName='价格' then
begin
if ADOQuery1.FieldByName('价格').AsFloat< then
begin
DBGridEh1.Canvas.Font.Color := clRed;
DBGridEh1.DefaultDrawColumnCell(Rect, DataCol, Column, State);
end;
end;
//整个框颜色
DBGridEh1.Canvas.Brush.Color:=clMaroon;
DBGridEh1.Canvas.Font.Color:=clWhite;
DBGridEh1.DefaultDrawColumnCell(Rect,DataCol,Column,State);
3、字段显示分层

如实现 这种效果
1、选择TDBGridEH,设置属性:UseMultiTitle:True.
2、右击TDBGridEH,选择Columns Editor,选择上分层的字段,如:caption:重量|生铁
二、TDBNumberEditEh:保能输入数字
1、Imemode属性:
imClose 表示输入法处于关闭状态;
ImOpen 表示输入法处于打开状态;
ImChinese 表示处于中文输入法状态;
ImDontCare 表示若输入法处于关闭状态则打开最近一次使用过的输入法;
ImSAlpha 表示输入处于半角状态;
ImAlpha 表示输入处于全角状态。
2、出现上下箭头
DBNumberEditEh1.EditButton.Visible:=true;
DBNumberEditEh1.EditButton.Style:=ebsDropDownEh;
问题:滑动鼠标会自动增加数字,因不需此功能,又无法去掉这个功能,后改用RzEdit里的控件。
三、TDBComboBoxEh
二、公用方法
function AddComboBoxEhList(TableName, KeyField, DisplayField: String;
CbB: TDbComboBoxEh; Condition: string = '';
bClear: Boolean = True): Boolean;
var DQ: TADOQuery;
begin
DQ := TADOQuery.Create(nil);
with DQ do
try
Result := False;
Connection := DMW_Public.DC_Pub;
Close;
SQL.Clear;
SQL.Add('select '+DisplayField);
if Trim(KeyField) <> '' then
SQL.Add(','+KeyField);
SQL.Add(' from '+ TableName);
if Condition <> '' then SQL.Add(Condition);
Open;
if bClear then
begin
CbB.KeyItems.Clear;
CbB.Items.Clear;
end;
while not Eof do
begin
if Trim(KeyField) <> '' then
CbB.KeyItems.Add(FieldByName(KeyField).AsString);
CbB.Items.Add(FieldByName(DisplayField).AsString);
Next;
end;
Result := True;
finally
Close;
Free;
end;
end;
直接 引用 : AddComboBoxEhList('pub_departments','id','name',cbb_department,' Order by id ');
添加/修改:cbb_department.KeyItems[cbb_department.ItemIndex]
修改加载:
1)已知item:cbb_department.Text:=FieldByName('syb').AsString;
2)只知keyItem: cbb_range.ItemIndex:= cbb_range.KeyItems.IndexOf(FieldByName('range').AsString);
根据条件加载:
AddComboBoxEhList('pub_branchs','id','name',cbb_FC,' Where pub_department_id='''+cbb_department.KeyItems[cbb_department.ItemIndex]+''' Order by id ');
清除内容:cbb_FC.Clear;
每次重新加载要清除KeyItems,Items
delphi---EHlib第三方插件----TDBGridEH,TDBNumberEditEh,TDBComboBoxEh的更多相关文章
- [试玩] FMXLinux (Firemonkey for Linux) Linux 桌面开发(第三方插件)
FMXLinux 是一个可以用来开发 Linux 桌面软件的第三方插件,它需要配合 Delphi 10.2 Toyko 官网:http://www.fmxlinux.com/ 使用方法:开启 FMX ...
- zabbix通过第三方插件percona监控mysql数据库
zabbix通过第三方插件percona监控mysql数据库 ...
- iOS 开发:利用第三方插件来安装CoCoapods
引言:通过上一篇博客我们知道了怎么样去通过终端来安装CoCoapods,这一篇我们着重与用第三方插件来安装CoCoapods: 1. 首先在提下链接下载插件 https://github.com/ka ...
- 苹果下如果安装nginx,给nginx安装markdown第三方插件
用brew install nginx 这样安装的是最新版的nginx, 但是在有些情况下,安装第三方插件需要特定的版本,更高一级的版本可能装不上. 它的原理是下载安装包进行自动安装,建立软链,这样就 ...
- ThinkPHP自动获取关键词(调用第三方插件)
ThinkPHP自动获取关键词调用在线discuz词库 先按照下图路径放好插件 方法如下 /** * 自动获取关键词(调用第三方插件) * @return [type] [description] * ...
- iOS 学习笔记 十 (2015.04.03)xcode第三方插件
1.xcode第三方插件,存放路径:~/Library/Application Support/Developer/Shared/Xcode/Plug-ins
- zatree第三方插件
Zabbix安装第三方插件zatree2.4.5 1.下载zatree第三方插件https://github.com/spide4k/zatree.git 2.检查PHP环境需要支持php-xml.p ...
- [iOS 10 day by day] Day 1:开发 iMessage 的第三方插件
本文介绍了 iOS 10 的一个重要更新:Messages 应用支持第三方插件了.作者用一个小游戏作为例子,说明了插件开发从建工程开始,到绘制界面.收发消息的全过程. <iOS 10 day b ...
- ionic3.0--angular4.0 引入第三方插件库的方法
ionic3.0 引入第三方插件 (swiper),方法很多,现详细说明下官方推荐(typings)做法. 1.全局安装Typings 1. npm install -g typings 2.搜索你 ...
随机推荐
- 区分SQL Server关联查询之inner join,left join, right join, full outer join并图解
1.from A inner join B on A.ID=B.ID :两表都有的记录才列出 A表: ID Name B表: ID Clas ...
- EF(EntityFramework) Migrations 迁移
1.开启程序包管理器控制台 2.安装EntityFramework PM> Install-Package EntityFramework 3.启用迁移 PM> Enable-Migr ...
- Unity向量投影使用
官方例图 测试: code: public Transform point1; public Transform point2; public Transform humanPoint; public ...
- csu-1328 近似回文词 和 最长回文字符串
原博文地址:http://blog.csdn.net/u012773338/article/details/39857997 最长回文子串 描述:输入一个字符串,求出其中最长的回文子串.子串的含义是: ...
- 李洪强iOS开发之iOS工具收集
李洪强iOS开发之iOS工具收集 项目 简述 日期 我是怎么慢慢变懒的 : Jenkins + 蒲公英 使用Jenkins + 蒲公英使得项目打包给测试人员自动化,大大节省了劳动力 2015.04.1 ...
- 谈一谈APP支付失败的处理
如题今天要描述一个问题是:程序在确认订单时拉起第三方支付,支付失败了,引起的问题. 为了能清楚的描述问题,我把场景复现一下,大家肯定都有过APP购物的体会,大家一定知道有一个按钮叫“确认”或者“结算” ...
- Oracle配置客户端
一.引言 当我们需要连接远程的Oracle数据库服务器时,就需要在自己的机器上安装Oracle客户端了. 二.安装步骤与配置 参考:http://blog.csdn.net/luiseradl/art ...
- nginx php-fpm安装手记
首先下载nginx,nginx下载地址:http://www.nginx.org/download/nginx-0.8.53.tar.gz[root@winsyk ~]# mkdir -p /usr/ ...
- git branch --set-upstream hmyq/master master
git branch --set-upstream hmyq/master master
- android RadioGroup实现单选以及默认选中
代码下载链接:http://download.csdn.net/detail/a123demi/7511835 本文将通过radiogroup和radiobutton实现组内信息的单选, 当中radi ...