Fórum Evento KeyPress x Backspace #618578
17/08/2022
0
Até ai tudo beleza!! o problema é quando utilizo a tecla "Backspace" para apagar, o Caption do Form não atualiza igual o edit a medida que digita.
Segue o código:
procedure TFrm_Clifor.FANTASIAKeyPress(Sender: TObject; var Key: Char);
var vCaption, vEdit : string;
begin
vCaption := 'Clientes/Fornecedores';
vEdit := fantasia.Text;
Frm_Clifor.Caption:= vCaption + vEdit + key;
end;
Willian Rodrigues
Curtir tópico
+ 1Post mais votado
18/08/2022
procedure TFrm_Clifor.FANTASIAKeyPress(Sender: TObject; var Key: Char);
var
vCaption, vEdit, vTitulo: string;
begin
vCaption := 'Clientes/Fornecedores';
vEdit := FANTASIA.Text;
vTitulo := vCaption + vEdit;
if Key <> #8 then
Caption := vTitulo + Key
else if FANTASIA.Text <> EmptyStr then
begin
Delete(vTitulo, Length(vTitulo), 1);
Caption := vTitulo;
end;
end;Natanael Ferreira
Gostei + 1
Mais Posts
18/08/2022
Willian Rodrigues
Fiz dessa maneira, rodou certinho.
Muito Obrigado.
Gostei + 0
23/08/2022
Lucas Santato
Até ai tudo beleza!! o problema é quando utilizo a tecla "Backspace" para apagar, o Caption do Form não atualiza igual o edit a medida que digita.
Segue o código:
procedure TFrm_Clifor.FANTASIAKeyPress(Sender: TObject; var Key: Char);
var vCaption, vEdit : string;
begin
vCaption := 'Clientes/Fornecedores';
vEdit := fantasia.Text;
Frm_Clifor.Caption:= vCaption + vEdit + key;
end;
Coloque no evento OnChange do edit
Caption := Edit.Text
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)