Order of Status Bar Panes.

Viewing 1 reply thread
  • Author
    Posts
    • #2563
      Steve Gill
      Participant

        Hi Ray,

        I have a TRzStatusBar component in an application with a number of panes.  The first pane’s alignment is set to alClient, and the rest are set to alRight.

        Let’s call them panes 1 to 9.  All is good at design time, but when the application runs panes 5 and 6 swap position for some weird reason.  Is there any way to force them to keep their order?

        Thanks.

        = Steve

         

      • #2570
        Ray Konopka
        Keymaster

          Hi Steve,

          The TRzStatusBar uses the built-in Align functionality to manage the positions of the status panes. The panes are separate controls and their position is defined by the Align property and their relative location to the other status panes. This is essentially no different than a panel with a bunch of labels (or other controls) with their Align properties set.

          With that said, in the VCL it is possible for controls to be repositioned relative to other controls that have the same Align value. Typically, this happens when controls are dynamically created, or the size of the control is changed at startup.

          The easiest way to fix the order is to set the Left property of the out of order control. Suppose Pane6 appears to the left of Pane5. To move Pane6, set Pane6.Left := Pane5.Left + 1; By change the Left property, the VCL will re-align the controls and position Pane6 to the right of Pane5.

          Hope this helps.
          Ray

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