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 >>

TAdvSmoothMegaMenu
Adding Sections and Items

Adding a root menu with a section and 5 items
  with AdvSmoothMegaMenu1.MenuItems.Add do
  begin
    Caption := 'Hello World !';
    with Menu.Sections.Add do
    begin
      Caption := 'Section 0';
      Items.Add.Text := 'Item 1';
      Items.Add.Text := 'Item 2';
      Items.Add.Text := 'Item 3';
      Items.Add.Text := 'Item 4';
      Items.Add.Text := 'Item 5';
    end;
  end;
Adding a root menu with 2 horizontal or vertical sections and for each section 5 items
  with AdvSmoothMegaMenu1.MenuItems.Add do
  begin
    Caption := 'Hello World !';
    Menu.SectionLayout := slHorizontal;
//    Menu.SectionLayout := slVertical;
    for I := 0 to 1 do
    begin
      with Menu.Sections.Add do
      begin
        Caption := 'Section ' + inttostr(I);
        Items.Add.Text := 'Item 1';
        Items.Add.Text := 'Item 2';
        Items.Add.Text := 'Item 3';
        Items.Add.Text := 'Item 4';
        Items.Add.Text := 'Item 5';
      end;
    end;
  end;
Adding a root menu with a section and 2 columns of items
  with AdvSmoothMegaMenu1.MenuItems.Add do
  begin
    Caption := 'Hello World !';
    with Menu.Sections.Add do
    begin
      Caption := 'Section 0';
      Items.Add.Text := 'Item 1';
      Items.Add.Text := 'Item 2';
      Items.Add.Text := 'Item 3';
      Items.Add.Text := 'Item 4';
      Items.Add.Text := 'Item 5';
      Items.Add.ItemType := itBreak;
      Items.Add.Text := 'Item 1';
      Items.Add.Text := 'Item 2';
      Items.Add.Text := 'Item 3';
      Items.Add.Text := 'Item 4';
      Items.Add.Text := 'Item 5';
    end;
  end;