appbar AppBar example
acAppBar component
Return to Introduction 
Following code demonstrates how to use some methods and events of the acAppBar component.

For example, you would like to delay popup of the "autohidden" AppBar (AutoHide = True) when the AppBar anchored to the edge of screen (some of your users may complain that when they moved their mouse too fast when trying to get a desktop icon or somewhere else and went too far and caused the AppBar to pop out even thoug they quickly moved it away). This example delays the appearing of hidden AppBar by N milliseconds.


{ Let's say we have a TTimer component on the form with interval of 2000 milliseconds). On program startup the timer is disabled (Timer1.Enabled = False)}

procedure
 TForm1.acAppBar1Unhiding(Sender: TObject;
  var AllowOperation: Boolean); // OnUnhiding event handler
begin
  AllowOperation := False; // Discard "unhiding"

  Timer1.Enabled := True;  // Starting the timer

end;

procedure TForm1.acAppBar1Activate(Sender: TObject);
begin // 
OnActivate event handler
  acAppBar1.ShowHiddenAppBar(True); // This will unhide the AppBar even if unhiding is disabled
end;

procedure TForm1.Timer1Timer(Sender: TObject); // This is OnTimer event of Timer1 component (must be on form)

begin
  if acAppBar1.IsMouseOverAppBar then
    acAppBar1.ShowHiddenAppBar(True);
  Timer1.Enabled := False;
end;