title: Ribbon hidden actions appear again
body: <p>I am using Delphi XE2 . In the main window of my program I have a ribbon, I created the ribbontabs and ribbon panels and have shares in the groups. Also, in another window I have a TreeView in which I set the access for each user to the ribbon , giving two possibilities for each action : Hide or Disable. The problem occurs when hidden actions , I do it dynamically by accessing the application. When minimizing and maximizing the Ribbon hidden actions appear again.</p>
  
  <p>This is my code:</p>
  
  <p>PAS:</p>
  
  <pre><code>    unit Example;
  
  interface
  
  uses
    Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
    Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ToolWin, Vcl.ActnMan, Vcl.ActnCtrls,
    Vcl.Ribbon, Vcl.RibbonLunaStyleActnCtrls, Vcl.ActnList, Vcl.StdCtrls;
  
  type
    TFormExample = class(TForm)
      ActionManagerExample: TActionManager;
      Ribbon1: TRibbon;
      RibbonPage1: TRibbonPage;
      RibbonPage2: TRibbonPage;
      RibbonGroup1: TRibbonGroup;
      RibbonGroup2: TRibbonGroup;
      RibbonGroup3: TRibbonGroup;
      RibbonGroup4: TRibbonGroup;
      Action1: TAction;
      Action2: TAction;
      Action3: TAction;
      Action4: TAction;
      Action5: TAction;
      Action6: TAction;
      Action7: TAction;
      Action8: TAction;
      Action9: TAction;
      Action10: TAction;
      ButtonClickMe: TButton;
      procedure ButtonClickMeClick(Sender: TObject);
      procedure Action1Execute(Sender: TObject);
      procedure Action2Execute(Sender: TObject);
      procedure Action3Execute(Sender: TObject);
      procedure Action4Execute(Sender: TObject);
      procedure Action5Execute(Sender: TObject);
      procedure Action6Execute(Sender: TObject);
      procedure Action7Execute(Sender: TObject);
      procedure Action8Execute(Sender: TObject);
      procedure Action9Execute(Sender: TObject);
      procedure Action10Execute(Sender: TObject);
    private
      { Private declarations }
    public
      { Public declarations }
    end;
  
  var
    FormExample: TFormExample;
  
  implementation
  
  {$R *.dfm}
  
  procedure TFormExample.Action10Execute(Sender: TObject);
  begin
    ShowMessage('Action 10');
  end;
  
  procedure TFormExample.Action1Execute(Sender: TObject);
  begin
    ShowMessage('Action 1');
  end;
  
  procedure TFormExample.Action2Execute(Sender: TObject);
  begin
    ShowMessage('Action 2');
  end;
  
  procedure TFormExample.Action3Execute(Sender: TObject);
  begin
    ShowMessage('Action 3');
  end;
  
  procedure TFormExample.Action4Execute(Sender: TObject);
  begin
    ShowMessage('Action 4');
  end;
  
  procedure TFormExample.Action5Execute(Sender: TObject);
  begin
    ShowMessage('Action 5');
  end;
  
  procedure TFormExample.Action6Execute(Sender: TObject);
  begin
    ShowMessage('Action 6');
  end;
  
  procedure TFormExample.Action7Execute(Sender: TObject);
  begin
    ShowMessage('Action 7');
  end;
  
  procedure TFormExample.Action8Execute(Sender: TObject);
  begin
    ShowMessage('Action 8');
  end;
  
  procedure TFormExample.Action9Execute(Sender: TObject);
  begin
    ShowMessage('Action 9');
  end;
  
  procedure TFormExample.ButtonClickMeClick(Sender: TObject);
  var
    I: Integer;
  begin
    for I := 0 to ActionManagerExample.ActionCount - 1 do
    begin
      if ActionManagerExample.Actions[i] is TCustomAction then
        TCustomAction(ActionManagerExample.Actions[i]).Visible := False;
    end;
  end;
  
  end.
  </code></pre>
  
  <p>DFM</p>
  
  <pre><code>    object FormExample: TFormExample
    Left = 0
    Top = 0
    Caption = 'Example'
    ClientHeight = 356
    ClientWidth = 699
    Color = clBtnFace
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    OldCreateOrder = False
    PixelsPerInch = 96
    TextHeight = 13
    object Ribbon1: TRibbon
      Left = 0
      Top = 0
      Width = 699
      Height = 143
      ActionManager = ActionManagerExample
      Caption = 'SSCCE'
      Tabs = &lt;
        item
          Caption = 'Page 1'
          Page = RibbonPage1
        end
        item
          Caption = 'Page 2'
          Page = RibbonPage2
        end&gt;
      ExplicitLeft = 480
      ExplicitTop = 72
      ExplicitWidth = 0
      DesignSize = (
        699
        143)
      StyleName = 'Ribbon - Luna'
      object RibbonPage2: TRibbonPage
        Left = 0
        Top = 50
        Width = 698
        Height = 93
        Caption = 'Page 2'
        Index = 1
        object RibbonGroup3: TRibbonGroup
          Left = 4
          Top = 3
          Width = 56
          Height = 86
          ActionManager = ActionManagerExample
          Caption = 'Group 3'
          GroupIndex = 0
        end
        object RibbonGroup4: TRibbonGroup
          Left = 62
          Top = 3
          Width = 56
          Height = 86
          ActionManager = ActionManagerExample
          Caption = 'Group 4'
          GroupIndex = 1
        end
      end
      object RibbonPage1: TRibbonPage
        Left = 0
        Top = 50
        Width = 698
        Height = 93
        Caption = 'Page 1'
        Index = 0
        object RibbonGroup1: TRibbonGroup
          Left = 4
          Top = 3
          Width = 56
          Height = 86
          ActionManager = ActionManagerExample
          Caption = 'Group 1'
          GroupIndex = 0
        end
        object RibbonGroup2: TRibbonGroup
          Left = 62
          Top = 3
          Width = 62
          Height = 86
          ActionManager = ActionManagerExample
          Caption = 'Group 2'
          GroupIndex = 1
        end
      end
    end
    object ButtonClickMe: TButton
      Left = 80
      Top = 200
      Width = 337
      Height = 97
      Caption = 'Click me and then minimize and maximize the ribbon'
      TabOrder = 1
      OnClick = ButtonClickMeClick
    end
    object ActionManagerExample: TActionManager
      ActionBars = &lt;
        item
          Items = &lt;
            item
              Action = Action1
              Caption = 'A&amp;ction 1'
            end
            item
              Action = Action2
              Caption = '&amp;Action 2'
            end
            item
              Action = Action3
              Caption = 'Ac&amp;tion 3'
            end&gt;
          ActionBar = RibbonGroup3
        end
        item
          Items = &lt;
            item
              Action = Action4
              Caption = '&amp;Action 4'
            end
            item
              Action = Action5
              Caption = 'A&amp;ction 5'
            end
            item
              Action = Action6
              Caption = 'Ac&amp;tion 6'
            end&gt;
          ActionBar = RibbonGroup4
        end
        item
          Items = &lt;
            item
              Action = Action7
              Caption = '&amp;Action 7'
            end
            item
              Action = Action8
              Caption = 'A&amp;ction 8'
            end
            item
              Action = Action9
              Caption = 'Ac&amp;tion 9'
            end&gt;
          ActionBar = RibbonGroup1
        end
        item
          Items = &lt;
            item
              Action = Action10
              Caption = '&amp;Action 10'
            end&gt;
          ActionBar = RibbonGroup2
        end&gt;
      Left = 528
      Top = 200
      StyleName = 'Ribbon - Luna'
      object Action1: TAction
        Caption = 'Action 1'
        OnExecute = Action1Execute
      end
      object Action2: TAction
        Caption = 'Action 2'
        OnExecute = Action2Execute
      end
      object Action3: TAction
        Caption = 'Action 3'
        OnExecute = Action3Execute
      end
      object Action4: TAction
        Caption = 'Action 4'
        OnExecute = Action4Execute
      end
      object Action5: TAction
        Caption = 'Action 5'
        OnExecute = Action5Execute
      end
      object Action6: TAction
        Caption = 'Action 6'
        OnExecute = Action6Execute
      end
      object Action7: TAction
        Caption = 'Action 7'
        OnExecute = Action7Execute
      end
      object Action8: TAction
        Caption = 'Action 8'
        OnExecute = Action8Execute
      end
      object Action9: TAction
        Caption = 'Action 9'
        OnExecute = Action9Execute
      end
      object Action10: TAction
        Caption = 'Action 10'
        OnExecute = Action10Execute
      end
    end
  end
  </code></pre>
  
  <p>Anyone know how I can do to remain hidden ? happens internally in this film that makes stocks appear ?</p>
  
  <p>Excuse this ribbon brings me many problems and has many bugs . But want to implement in my work . :-(</p>