 |
ActiveDelphi .: O site do programador Delphi! :.
|
| Exibir mensagem anterior :: Exibir próxima mensagem |
| Autor |
Mensagem |
tedeski Novato

Registrado: Segunda-Feira, 28 de Janeiro de 2013 Mensagens: 96 Localização: São Jose dos Pinhais-PR
|
Enviada: Qua Ago 20, 2014 8:57 am Assunto: Mascara em edit?? [Resolvido] |
|
|
Bom dia estou desenvolvendo uma aplicação para android com o delphi xe6, e não estou conseguindo aplicar mascara alguem tem ideia de como fazer??
Editado pela última vez por tedeski em Qua Ago 20, 2014 1:37 pm, num total de 1 vez |
|
| Voltar ao Topo |
|
 |
flexsistemas Aprendiz

Registrado: Terça-Feira, 29 de Outubro de 2013 Mensagens: 121 Localização: Caxias do Sul
|
Enviada: Qua Ago 20, 2014 1:06 pm Assunto: |
|
|
tente utilizar algo como isso após abrir a query:
| Código: |
class procedure TFuncoesVisuais.LayoutCampos(pClientDataSet: TClientDataSet);
var
lIdx: Integer;
lCampoCur: TBCDField;
lCampoData: TDateField;
lCampoHora: TTimeField;
begin
if Assigned(pClientDataSet) then
for lIdx := 0 to pClientDataSet.Fields.Count -1 do
begin
if pClientDataSet.Fields[lIdx] is TBCDField and (pClientDataSet.Fields[lIdx].Size = 2) then
begin
lCampoCur := (pClientDataSet.Fields[lIdx] as TBCDField);
lCampoCur.DisplayFormat := '#,###,##0.00';
lCampoCur.EditFormat := '#,###,##0.00';
lCampoCur.currency := True;
end
else
if pClientDataSet.Fields[lIdx] is TBCDField and (pClientDataSet.Fields[lIdx].Size = 3) then
begin
lCampoCur := (pClientDataSet.Fields[lIdx] as TBCDField);
lCampoCur.DisplayFormat := '#,###,##0.000';
lCampoCur.EditFormat := '#,###,##0.000';
lCampoCur.currency := True;
end
else
if pClientDataSet.Fields[lIdx] is TDateField then
begin
lCampoData := (pClientDataSet.Fields[lIdx] as TDateField);
lCampoData.DisplayFormat := 'dd/mm/yyyy';
lCampoData.EditMask := '##/##/####';
end
else
if pClientDataSet.Fields[lIdx] is TTimeField then
begin
lCampoHora := (pClientDataSet.Fields[lIdx] as TTimeField);
lCampoHora.DisplayFormat := 'hh:nn';
lCampoHora.EditMask := '##:##';
end;
end;
end;
|
|
|
| Voltar ao Topo |
|
 |
flexsistemas Aprendiz

Registrado: Terça-Feira, 29 de Outubro de 2013 Mensagens: 121 Localização: Caxias do Sul
|
Enviada: Qua Ago 20, 2014 1:07 pm Assunto: |
|
|
ou
| Código: |
class procedure TFuncoesVisuais.LayoutCampos(pFDQuery: TFDQuery);
var
lIdx: Integer;
lCampoCur: TBCDField;
lCampoData: TDateField;
lCampoHora: TTimeField;
begin
if Assigned(pFDQuery) then
for lIdx := 0 to pFDQuery.Fields.Count -1 do
begin
if pFDQuery.Fields[lIdx] is TBCDField and (pFDQuery.Fields[lIdx].Size = 2) then
begin
lCampoCur := (pFDQuery.Fields[lIdx] as TBCDField);
lCampoCur.DisplayFormat := '#,###,##0.00';
lCampoCur.EditFormat := '#,###,##0.00';
lCampoCur.currency := True;
end
else
if pFDQuery.Fields[lIdx] is TBCDField and (pFDQuery.Fields[lIdx].Size = 3) then
begin
lCampoCur := (pFDQuery.Fields[lIdx] as TBCDField);
lCampoCur.DisplayFormat := '#,###,##0.000';
lCampoCur.EditFormat := '#,###,##0.000';
lCampoCur.currency := True;
end
else
if pFDQuery.Fields[lIdx] is TDateField then
begin
lCampoData := (pFDQuery.Fields[lIdx] as TDateField);
lCampoData.DisplayFormat := 'dd/mm/yyyy';
lCampoData.EditMask := '##/##/####';
end
else
if pFDQuery.Fields[lIdx] is TTimeField then
begin
lCampoHora := (pFDQuery.Fields[lIdx] as TTimeField);
lCampoHora.DisplayFormat := 'hh:nn';
lCampoHora.EditMask := '##:##';
end;
end;
end;
|
|
|
| Voltar ao Topo |
|
 |
tedeski Novato

Registrado: Segunda-Feira, 28 de Janeiro de 2013 Mensagens: 96 Localização: São Jose dos Pinhais-PR
|
Enviada: Qua Ago 20, 2014 1:32 pm Assunto: |
|
|
funcionou mas somente depois que saio do campo, mas ja é o suficiente. Muito Obrigado.
| flexsistemas escreveu: | tente utilizar algo como isso após abrir a query:
| Código: |
class procedure TFuncoesVisuais.LayoutCampos(pClientDataSet: TClientDataSet);
var
lIdx: Integer;
lCampoCur: TBCDField;
lCampoData: TDateField;
lCampoHora: TTimeField;
begin
if Assigned(pClientDataSet) then
for lIdx := 0 to pClientDataSet.Fields.Count -1 do
begin
if pClientDataSet.Fields[lIdx] is TBCDField and (pClientDataSet.Fields[lIdx].Size = 2) then
begin
lCampoCur := (pClientDataSet.Fields[lIdx] as TBCDField);
lCampoCur.DisplayFormat := '#,###,##0.00';
lCampoCur.EditFormat := '#,###,##0.00';
lCampoCur.currency := True;
end
else
if pClientDataSet.Fields[lIdx] is TBCDField and (pClientDataSet.Fields[lIdx].Size = 3) then
begin
lCampoCur := (pClientDataSet.Fields[lIdx] as TBCDField);
lCampoCur.DisplayFormat := '#,###,##0.000';
lCampoCur.EditFormat := '#,###,##0.000';
lCampoCur.currency := True;
end
else
if pClientDataSet.Fields[lIdx] is TDateField then
begin
lCampoData := (pClientDataSet.Fields[lIdx] as TDateField);
lCampoData.DisplayFormat := 'dd/mm/yyyy';
lCampoData.EditMask := '##/##/####';
end
else
if pClientDataSet.Fields[lIdx] is TTimeField then
begin
lCampoHora := (pClientDataSet.Fields[lIdx] as TTimeField);
lCampoHora.DisplayFormat := 'hh:nn';
lCampoHora.EditMask := '##:##';
end;
end;
end;
|
|
|
|
| Voltar ao Topo |
|
 |
flexsistemas Aprendiz

Registrado: Terça-Feira, 29 de Outubro de 2013 Mensagens: 121 Localização: Caxias do Sul
|
Enviada: Qua Ago 20, 2014 1:36 pm Assunto: |
|
|
| blza só coloca como resolvido, vamos ajudar outros colegas! |
|
| Voltar ao Topo |
|
 |
|
|
Enviar Mensagens Novas: Proibido. Responder Tópicos Proibido Editar Mensagens: Proibido. Excluir Mensagens: Proibido. Votar em Enquetes: Proibido.
|
|