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选中的行 可删除多行