您的位置:程序门 -> delphi -> vcl组件开发及应用



创建dbmygrideh的字段名称


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


创建dbmygrideh的字段名称
发表于:2007-09-11 16:11:40 楼主
const
    ed_str=   'ed';
    and_str   =   '   and   ';
.
.
.

procedure   tformbase1.createaedit(sname:   string;   itime,   flag:   integer);
var
    edtmp:   tdxedit;
begin
    edtmp   :=   tdxedit.create(self);
        edtmp.name   :=sname   +   ed_str+inttostr(itime);(如果数据库中的字段名是中文字或数据字则出错提示'**is   not   a   valid   component   name'请问高手要如可解决)

        edtmp.stylecontroller   :=   dxmystyle;
        edtmp.parent   :=   tpsearch;
        edtmp.tag   :=   itime   ;
        edtmp.height   :=   22;
        edtmp.top   :=   tpsearch.top+2;//tpsearch.height   -   edtmp.height-1;//   *   (itime-1)+2   ;
        edtmp.text   :=   '';
        edtmp.onkeydown   :=   ededitkeydown;
        edtmp.onchange   :=   editchange;
        edtmp.width   :=   0;
        lstedits.add(edtmp);
end;
发表于:2007-09-11 16:19:001楼 得分:0
component.name不支持中文
发表于:2007-09-11 16:27:582楼 得分:0
请问楼上的那要怎么样处理呀
发表于:2007-09-11 17:33:493楼 得分:0
这个应该没办法解决吧!组件名就是不能用中文的,只有你换种方法给edtmp命名了!
发表于:2007-09-11 17:46:104楼 得分:0
组件名称不能使用中文。
发表于:2007-09-12 09:54:345楼 得分:0
请问各位sname   用什么代替好
发表于:2007-09-12 10:25:276楼 得分:0
请问可不可以将中文转换成字母呢,代码怎么写呀
发表于:2007-09-12 10:38:347楼 得分:0
edtmp.name   可以随便取个唯一的就可以,比如   某字母+inttostr(序号)。另外,如果你的   sname   +   ed_str+inttostr(itime)   另有它用,可以把这个值存储在edtmp.helpkeyword等区域。


快速检索

最新资讯
热门点击