检查小数点是否已经存在

EditKeyPressOnlyFloat((Sender as TEdit).Text, Key);

procedure EditKeyPressOnlyFloat(sStr: string; var Key: Char);

begin

    if (key in ['0'..'9', #13, #8]) then  //输入只能是数值

        Exit

    else if key = '.' then //检查是否已存在小数点    #$2E:

    begin

        if (DotInStr(sStr)) then

            Key := #0;

        Exit;

    end

    else

        Key := #0;

end;               

procedure  ClearText(edt1,edt2,edt3,edt4,edt5,edt6:TEdit;cmbedt1,cmbedt2:TComboBox);

begin

  cmbedt1.Text:='';

  cmbedt2.Text:='';

  edt1.Text:='';

  edt2.Text:='';

  edt3.Text:='';

  edt4.Text:='';

  edt5.Text:='';

  edt6.Text:='';

end;

 

ClearText(MinEdit,MinmEdit,MaxEdit,MaxmEdit,MidEdit,ZhxEdit,GgEdit,BhEdit);

清空文本框 调用函数

 

 

procedure SortDBGridEh(Column: TColumnEh; SourceQuery: TADODataSet);

begin

    try

        if (Column.Title.SortMarker = smDownEh) then

        begin

            SourceQuery.Sort := Column.FieldName + ' ASC';

            Column.Title.SortMarker := smUpEh;  // 列标题上显示的箭头方向

        end

        else

        begin

            SourceQuery.Sort := Column.FieldName + ' DESC';

            Column.Title.SortMarker := smDownEh;

        end;

    except

    end;

end;

 

SortDBGridEh(Column, TADODataSet(DBGridEh1.DataSource.DataSet));

// 点击Grid的标题排序

 

if DBGridEh1.SelectedRows.Count>0 then

    begin

     DBGridEh1.SelectedRows.Delete;

    end

    else

DBGridEh1.DataSource.DataSet.Delete;//删除dbgrid选中的行 可删除多行

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值