摘要:
在Delphi SysUtils 单元中有 ExtractFileDir 与 ExtractFilePath两个类似的函数, 两个函数有以下的区别: ExtractFilePath 传回值的最後一个字元是反斜杠“/”。ShowMessage(ExtractFileDir(Application.Ex... 阅读全文
随笔分类 - Delphi
Delphi ini文件读写
2014-09-13 09:45 by 李龙江, 327 阅读, 收藏, 编辑
摘要:
首先把IniFiles加入到interface的uses里,这样才能使用Tinifile类,其他代码如下implementation{$R *.dfm}var inifile: Tinifile; filepath: string;procedure TForm1.Button1Clic... 阅读全文
DBGridEh常用技巧
2013-07-13 21:42 by 李龙江, 896 阅读, 收藏, 编辑
摘要:
一、增加多表头显示方式DBGridEh1.UseMultiTitle:=True; //打开多标题显示方式DBGridEh1.Columns[0].Title.Caption:='员工编号'; //第一列的标题DBGridEh1.Columns[1].Ti... 阅读全文
AdvStringGrid入门使用
2013-07-11 13:36 by 李龙江, 831 阅读, 收藏, 编辑
摘要:
仅仅把数据从数据库中显示到AdvStringGrid中procedure TForm1.btnQueryClick(Sender: TObject);var i, j: Integer;begin qry1.Close; qry1.SQL.Clear; qry1.SQL.Ad... 阅读全文
Delphi开发的一些技巧
2013-06-06 18:41 by 李龙江, 3605 阅读, 收藏, 编辑
摘要:
[Delphi]Delphi开发的一些技巧 一、提高查询效率先进行准备查询操作:CustomerQuery.Close;if not (CustomerQuery.Prepared) then -->查询是否已准备好CustomerQuery.Prepare; -->查询准备CustomerQuer... 阅读全文
获取的数据载入listview控件中
2013-06-02 19:47 by 李龙江, 332 阅读, 收藏, 编辑
摘要:
ListView1.Items.Clear; ADOQuery1.close; ADOQuery1.sql.clear; ADOQuery1.sql.add('select * from Employees'); ADOQuery1.Open; while no... 阅读全文
Delphi ADOQuery连接数据库的查询、插入、删除、修改
2012-12-15 14:17 by 李龙江, 15524 阅读, 收藏, 编辑
摘要:
//查询记录procedure TForm1.Button1Click(Sender: TObject);beginADOQuery.Close;ADOQuery.SQL.Clear;ADOQuery.SQL.Add('select * from YourTABLE where 查询条件');ADO... 阅读全文
edit编辑框只能输入数字和一个小数点
2011-07-05 19:44 by 李龙江, 368 阅读, 收藏, 编辑
摘要:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);begin ifnot(Key in [#48 .. #57, #8, #46]) then//#48-#57[0-9],#8[删除键],#49[小数点] Key :... 阅读全文
Indy IdHttp get Gb2312乱码的解决
2011-07-04 14:43 by 李龙江, 2416 阅读, 收藏, 编辑
摘要:
procedure TForm1.Button1Click(Sender: TObject);var ss: TStringStream; url: string;begin url := 'http://www.hao123.com'; ss := TStringStream.Create... 阅读全文
Combobox控件使用
2011-06-09 08:42 by 李龙江, 678 阅读, 收藏, 编辑
摘要:
增加字段ComboBox1.Items.Add(‘添加内容’);追加字段combobox1.Items.Append('内容');选中项索引值ComboBox1.ItemIndex删除当前选中项combobox1.Items.Delete(combobox1.ItemIndex);选中项的文本内容C... 阅读全文