Skip to main content

TdxBarItem.Visible Example

This example requires a TEdit object and demonstrates a method to hide and display item controls when you move through controls on a form. When TEdit gets focus, the color combo and the font combo on the toolbar are made visible to set the text font or text color for the TEdit control. When the TEdit control loses focus, the font name combo and color combo are hidden. The following code snippet represents the OnEnter and OnExit event handlers.

procedure TForm1.Edit1Enter(Sender: TObject);
begin
  dxBarFontNameCombo1.Visible := ivAlways;
  dxBarColorCombo1.Visible := ivAlways;
end;
procedure TForm1.Edit1Exit(Sender: TObject);
begin
  dxBarFontNameCombo1.Visible := ivNever;
  dxBarColorCombo1.Visible := ivNever;
end;