Tema: algo raro
Ver Mensaje Individual
  #7  
Antiguo 03-01-2005
Avatar de roman
roman roman is offline
Moderador
 
Registrado: may 2003
Ubicación: Ciudad de México
Posts: 20.269
Reputación: 10
roman Es un diamante en brutoroman Es un diamante en brutoroman Es un diamante en bruto
Intenta algo como esto:

Código Delphi [-]
{$writeableconst on}
procedure TForm1.DateTimePicker2Change(Sender: TObject);
const
  Changing: Boolean = false;

begin
  if not Changing then
    ShowMessage('la fecha de finalizacion es menor que la de inicio.');

  Changing := not Changing;
end;
{$writeableconst off}

EDITO:

Lo anterior no funciona muy bien: si cambias con el teclado la fecha mientras está desplegado el calendario se muestra el mensaje una vez sí y otra no.

Veamos el siguiente intento:

Código Delphi [-]
procedure TForm1.DateTimePicker2Change(Sender: TObject);
begin
  if DateTimePicker1.Date <> Date then
  begin
    ShowMessage('Hola');
    Date := DateTimePicker1.Date;
  end;
end;

donde Date es una variable de tipo TDate que puedes inicializar con el valor de DateTimePicker2.Date.

// Saludos

Última edición por roman fecha: 03-01-2005 a las 08:23:06.
Responder Con Cita