to geng7758:
不会麻烦!
我的死客户,要求:
1。自定义窗口(界面上的所有空件)
2。自定义报表
3。自定义网格(DBGrid的显示)
我都做出来了,不会很烦,还可以!!
大概思路:([red]弄一点代码给你,可能有一点启示[/red])
if (Components is TLabel) then
begin
ls_Insert := 'INSERT INTO T_PUB_FORM VALUES (';
ls_Insert := ls_Insert + #39 + ComboBox1.Text + #39 + ',';//著录表名称
ls_Insert := ls_Insert + #39 + '0' + #39 + ',';//是否默认
ls_Insert := ls_Insert + #39 + (Components as TLabel).Name + #39 + ',';//控件名称
if (Components as TLabel).Visible then
ls_Insert := ls_Insert + #39 + '1' + #39 + ','//是否可见(可见--1,不可见--0)
else
ls_Insert := ls_Insert + #39 + '0' + #39 + ',';
ls_Insert := ls_Insert + #39 + (Components as TLabel).Font.Name + #39 + ',';//字体名称
ls_Insert := ls_Insert + #39 + IntToStr((Components as TLabel).Font.Size) + #39 + ',';//字体大小
//判断字体的效果
if fsBold in ((Components as TLabel).Font.Style) then
ls_Font_Style := '粗体'
else
if fsItalic in ((Components as TLabel).Font.Style) then
ls_Font_Style := '斜体'
else
if fsUnderline in ((Components as TLabel).Font.Style) then
ls_Font_Style := '下划线'
else
if fsStrikeOut in ((Components as TLabel).Font.Style) then
ls_Font_Style := '删除线'
else
ls_Font_Style := '常规';
ls_Insert := ls_Insert + #39 + ls_Font_Style + #39 + ',';//字体效果
ls_Insert := ls_Insert + #39 + IntToStr((Components as TLabel).Font.Color) + #39 + ',';//字体颜色
ls_Insert := ls_Insert + #39 + IntToStr((Components as TLabel).Color) + #39 + ',';//控件颜色
ls_Insert := ls_Insert + #39 + (Components as TLabel).Caption + #39 + ',';//控件内容
ls_Insert := ls_Insert + #39 + #39 + ',';//数据源(用的是Hint属性)
ls_Insert := ls_Insert + #39 + #39 + ',';//TAB_ORDER;
ls_Insert := ls_Insert + #39 + IntToStr((Components as TLabel).Width) + #39 + ',';//控件长度
ls_Insert := ls_Insert + #39 + IntToStr((Components as TLabel).Height) + #39 + ',';//控件宽度
ls_Insert := ls_Insert + #39 + IntToStr((Components as TLabel).Left) + #39 + ',';//控件x
ls_Insert := ls_Insert + #39 + IntToStr((Components as TLabel).Top) + #39 + ')';//控件y
if ls_Insert <> '' then
begin
With Pub_Connection.ADOQ_Maindo
begin
Close;
SQL.Clear;
SQL.ADD(ls_Insert);
ExecSQL;
end;
end;
end;
[blue]试一试!![/blue]