RZTOOLBAR clear buttons

Viewing 1 reply thread
  • Author
    Posts
    • #1393
      Alvaro Perez
      Participant

        Hi, how can I delete all the buttons of a rztoolbar by code ?

        I need to delete all then adds new ones depending my user level access.

        Thanks

      • #1403
        Ray Konopka
        Keymaster

          Hi,
          I apologize for the delay in responding. One thing to consider when dealing with user access is that it may be better to simply hide the controls that are not applicable to the current user’s access.

          However, given your question about deleting buttons from a TRzToolbar, you can accomplish this by simply freeing the toolbar controls. For example,

          var
            I: Integer;
          begin
            for I := RzToolbar1.ControlCount - 1 downto 0 do
              RzToolbar1.Controls[ I ].Free;

          Ray

      Viewing 1 reply thread
      • You must be logged in to reply to this topic.