Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TMS Advanced Toolbars & Menus
Providing an Office 2007 type hint for any control

The TMS components that have built-in support for Office 2007 type hints expose the property OfficeHint with which the hint title, notes, picture and help line can be set. If you want to use an Office 2007 for another standard VCL component or other 3rd party component, you can use the event AdvOfficeHint.OnBeforeShowHint. This sample demonstrates how this can be done. Via the event handler, an Office 2007 hint is set for a TAdvSmoothButton:
procedure TForm1.AdvOfficeHint1BeforeShowHint(Sender: TObject;
  AControl: TControl; AHintInfo: TAdvHintInfo; var UseOfficeHint: Boolean);
begin
  if AControl = AdvSmoothButton1 then
  begin
    UseOfficeHint := true;  // set true to tell the TAdvOfficeHint it should display the hint in Office 2007 style
    AHintInfo.Title := 'Button title';
    AHintInfo.Notes.Text := AControl.Hint;
    AHintInfo.Picture.LoadFromFile(''); // optionally add a hint picture here from file, resource or stream
  end;
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
  // set the standard Hint to make sure it shows, this is reused as hint notes
  AdvSmoothButton1.Hint := 'Smooth button hint';
end;