Impedindo ctrl+del num dbgrid no Delphi
Como impedir de apagar um registro em um DBGRID através das teclas CTRL+DEL?
Colocar no evento OnKeyDown do DBGRID:
Como impedir de apagar um registro em um DBGRID através das teclas CTRL+DEL?
Colocar no evento OnKeyDown do DBGRID:
Var
sArquivo: TextFile;
Entrada, sArq2: string;
iLinha: integer;
begin
tblCep.Open;
tblCepLoc.Open;
bCancelaImport := False;
AssignFile(sArquivo, FileNameEdit1.FileName);
sArq2 := After(‘Cep_Loc.txt’,FileNameEdit1.FileName);
//Função para transformar minutos em horas
//Ex: 90 min = 1:30
Function MinparaHora(Minuto: integer): string;
var
hr, min : Integer;
begin
hr := 0;
while minuto >= 60 do begin
minuto := minuto – 60;
hr := hr + 1;
end;
min := minuto;
Result := FormatFloat(’00:’, hr) + FormatFloat(’00’, min);
end;
DBLookupComboBox1.KeyValue:=’ ‘;
Procedure LimpaEdit;
var
i : Integer;
begin
for i := 0 to ComponentCount -1 do
if Components[i] is TEdit then
begin
TEdit(Components[i]).Text := ”;
end;
end; ou
Procedure TForm1.Memo1KeyPress(Sender: TObject; var Key: Char);
begin
Key:= Upcase(Key);
end;
É fácil saber a coluna que você está no DBGrid.
Para isso vamos usar a propriedade SelectedIndex que retorna o número da coluna.
--ignore
--size-err
--beep
--beep-after
--sleep <N>
--timeout <N>
--no-kill
--print-size
--and-widget
Function TForm1.AnoBiSsexto(Ayear: Integer): Boolean;
begin
Result := (AYear mod 4 = 0) and ((AYear mod 100 <> 0) or (AYear mod 400 = 0));
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if AnoBiSexto(1999) Then
ShowMessage(‘Ano de 1999 é Bissexto’)
Else ShowMessage(‘Ano de 1999 não é Bissexto’);
end;
--clear
--create-rc <arquivo>
--help
--print-maxsize
--print-version
--version
--separate-output
--separate-widget <separador>
--stderr
--stdout
--max-input <tamanho>
--aspect <taxa>
--begin <y> <x>
--defaultno
--default-item <item>
--shadow
--no-shadow
--no-cancel ou --nocancel
--item-help
--help-button
--cr-wrap
--no-collapse
--tab-correct
--tab-len <N>
--trim
--backtitle <texto>
--title <texto>
--cancel-label <texto>
--exit-label <texto>
--help-label <texto>
--ok-label <texto>
É possível configurar as cores de TODOS os componentes das caixas, como textos, borda, botões e fundo da tela. Dessa maneira pode-se personalizar os programas que usam o Dialog para a empresa ou indivíduo que o utilizará.