Mega Code Archive

 
Categories / Delphi / Examples
 

[] Bilgi kontrol

//MURATTAN if ActiveControl is TEdit then TEdit(ActiveControl).SelectAll; //tarih alanı olduğunu düşünürsek if TABLO.FieldByName('DTARIHI').isnull then Begin MessageDlg('Girmiş olduğunuz tarih geçersiz', mtWarning, [mbOK], 0); Exit; end; {sayısal alan olursa yine aynı mantık işletilebilir. sacede mesajın içeriğini değiştirmek yeterli olacak} //tablonun durumuna göre butonun durumunu değiştirme if DataSource1.Dataset <> nil then PostButton.Enabled := DataSource1.State in [dsEdit, dsInsert]; //tablo durumları TDataSetState = (dsInactive, dsBrowse, dsEdit, dsInsert, dsSetKey, dsCalcFields, dsFilter, dsNewValue, dsOldValue, dsCurValue, dsBlockRead, dsInternalCalc, dsOpening); //düzenleme veya ekleme modunda ise if Table1.State in [dsEdit,dsInsert] then //düzenleme modunda ise if Table1.State = dsEdit then