Delphi进销存系统的设计与实现 第18页

select @Code='C'+Cast(@Mid As char)

 begin transaction

  insert into TCustomer(C_Code,C_Name,C_Addr,Area_Code,Contact1,C_tel,C_Date)values(@Code,@Name,@Addr,@Area_Code,@Contact1,@Tel,GetDate());

 commit

GO

③操作时,利用回车实现在界面中不同控件中进行切换

可将Form中的KeyPreview的属性设为True,然后在FormKeyPress事件中添加如下代码:

begin

if key=#13 then

    begin

      key:=#0;

      perform(WM_NEXTDLGCTL,0,0);

    end;

end;

④实现在文本框中只能输入数值型数据:

var p:integer;

begin

if key in['0'..'9','.'] then

begin

  if key='.' then

  begin

   p:=Pos('.',edit5.Text);

   if p>0 then key:=#0;

  end;

 end

 else if  key>#31 then key:=#0;

 << 上一页  [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]  ... 下一页  >> 

Copyright © 2007-2012 www.chuibin.com 六维论文网 版权所有