Ver Mensaje Individual
  #4  
Antiguo 18-01-2008
Avatar de Lepe
[Lepe] Lepe is offline
Miembro Premium
 
Registrado: may 2003
Posts: 7.424
Reputación: 31
Lepe Va por buen camino
Ya que tienes un frame, yo haría esto en tu frame:


Espero no te confunda los nombres que he usado, como ves, he puesto los mismos nombres que tú, pero anteponiendo el prefijo "sb" de ShowButtons

Código Delphi [-]

type TShowButtons = set of (sbNewPatient, sbEditPatient, sbDeletePatient, 
    sbNewStudy, sbEditStudy, sbDeleteStudy, sbCamera, sbPrint, sbBack);

type TfrToolbar = class(TFrame)


private 
  FShowButtons :TShowButtons;
  procedure SetShowButtons(Value:TShowButtons);
public
  property ShowButtons : TShowButtons read FShowButtons write SetShowButtons;
end

Implementation

procedure TfrToolbar.SetShowbuttons(Value:TShowButtons);
begin
    FShowButtons := Value;
    boNewPatient.Visible:= sbNewPatient in Value;
    boDeletePatient.Visible:= sbDeletePatient in Value;
    boNewStudy.Visible:= sbNewStudy in Value;
    boEditStudy.Visible  := sbEditStudy in Value;
    boDeleteStudy.Visible:= sbDeleteStudy in Value;
    boCamera.Visible:= sbCamera in Value;
    boPrint.Visible:= sbPrint in Value;
    boBack.Visible:= sbBack in Value;
end;

Ahora ya no tienes que ocultar los botones antes de cambiar ventana.
Cuando cambies de ventana, si en esa ventana debes mostrar los botones NewPatient, DeletePatient, Print y Back, harías esto:
Código Delphi [-]
with frmMain.frtoolbar do
 ShowButtons := [sbNewPatient, sbDeletePatient, sbPrint, sbBack];
Al asignar la propiedad ShowButtons, dentro del frame se ejecutará el procedimiento SetShowButtons que pondrá visible los botones que hayas especificado. El resto de botones los pondrá invisibles.


Saludos
__________________
Si usted entendió mi comentario, contácteme y gustosamente,
se lo volveré a explicar hasta que no lo entienda, Gracias.
Responder Con Cita