Ver Mensaje Individual
  #9  
Antiguo 01-06-2007
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
A mi me ha funcionado así:

Código Delphi [-]
procedure TForm1.DateTimePicker1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if KEY = VK_CONTROL then
    if DateTimePicker1.DroppedDown then
    begin
      keybd_event(VK_CONTROL, 0, KEYEVENTF_KEYUP, 0 );
      keybd_event(VK_ESCAPE, 0, 0, 0 );
    end
    else
    begin
      keybd_event(VK_F4, 0, 0, 0 );
    end;
end;

Si nada más pongo keybd_event(VK_ESCAPE, 0, 0, 0 ) actúa conmo si oprimiese Ctrl+Esc de manera que aparece el menú de inicio de Windows y no se cierra el DateTimePicker.

// Saludos
Responder Con Cita