Fórum Desativar um Botao caso a tabela estaja vazia #226704
17/04/2004
0
Vispo
Curtir tópico
+ 0Posts
17/04/2004
Debug
procedure TMasterCad.ToolBar_Botoes( Inserindo : Boolean = True); begin TBNovo .Enabled := not Inserindo; TBEditar.Enabled := (not Inserindo) and (not TabelaMaster.IsEmpty); TBCancelar.Enabled := Inserindo; TBApagar.Enabled := (not Inserindo) and (not TabelaMaster.IsEmpty); TBSalvar.Enabled := Inserindo; TBLocalizar.Enabled := not Inserindo; TBFechar.Enabled := not Inserindo; end; procedure TMasterCad.DSTabelaMasterStateChange(Sender: TObject); begin inherited; ToolBar_Botoes(State_Insert(TabelaMaster)); end;
Gostei + 0
18/04/2004
Maxadens
Coloque o seguinte comando no botão excluir
if TABELA.recordcount=0 then
application.messagebox(´Não existe registro para excluir!´,´Aviso´,mb_Iconexclamation)
else
TABELA.delete;
obs: Não sei se todas as palavras estão escritar corretamente pois estou se Delphi aqui no momento. Mas tenho certeza que é isso ai e funciona.
Gostei + 0
18/04/2004
Lucas Silva
fica bem mais rápido, seu programa.
Gostei + 0
19/04/2004
Lindomir
botao.Enabled := false;
Gostei + 0
19/04/2004
Emerson Nascimento
Gostei + 0
21/04/2004
Vispo
Abraços
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)