Ver Mensaje Individual
  #6  
Antiguo 13-05-2007
Avatar de cHackAll
[cHackAll] cHackAll is offline
Baneado?
 
Registrado: oct 2006
Posts: 2.159
Reputación: 22
cHackAll Va por buen camino
Cool Solucion parcial

Ahhh tienes toda la razón!!! pero esta definitivamente relacionado (el problema) con el foco del objeto y la forma en que los botones reaccionan!
Realizado un pequeño análisis es un error de la VCL, pero bueno aca te dejo una forma de solucionar tu problema:

Código Delphi [-]
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
var Index, Pos: Cardinal; WinControl: TWinControl;
begin
 Index := ControlCount;
 while Index <> 0 do
  begin
   Dec(Index);
   if (Controls[Index] is TButton) then
    with Controls[Index] as TButton do
     begin
      Pos := System.Pos('&', Caption);
      if (Pos > 0) and (Pos < Length(Caption)) and
         ((Key = $20) or (Key = (Byte(Caption[Pos + 1]) and $DF))) and
         ((ssAlt in Shift) or (ActiveControl.Name = Name)) then
       OnMouseDown(nil, mbLeft, [], 0, 0);
     end;
   end;
end;
 
procedure TForm1.Button1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 if Button <> mbLeft then Exit;
 Application.MessageBox('Button 1', 'Pseudo OnClick');
end;
 
procedure TForm1.Button2MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
 if Button <> mbLeft then Exit;
 Application.MessageBox('Button 2', 'Pseudo OnClick');
end;

Espero te sirva!
Archivos Adjuntos
Tipo de Archivo: zip OnClick.zip (1,4 KB, 8 visitas)
Responder Con Cita