Problem on TRzPanel.Enabled

Tagged: 

Viewing 4 reply threads
  • Author
    Posts
    • #3836
      Andy Dai
      Participant

        Hi,

        When Change TRzPanel.Enabled, if component in TPzPanel, then component.enabled will auto relation TRzPanel.Enabled.

        how to disable relation ?

        Thanks

      • #3837
        Ray Konopka
        Keymaster

          Hi,
          I’m not sure I completely understand your question. Let me try to rephrase what I think you are asking. Consider a TRzPanel component on a form and inside that panel are other controls such as a TRzButton or TRzEdit. Then when you set the Enabled property of the TRzPanel to False, the Enabled property of the button and edit are also changed to False. And you are asking if that behavior can be disabled? Is that correct?

          This behavior is by design and cannot be changed without modifying the source code of the component. The reason the TRzPanel operates in this manner is because if you set up the form in the same way but use a TPanel instead of a TRzPanel, when you disable the panel, the button and edit inside the panel do not allow any user interaction, but the controls still appears as though they do allow interaction.

          Also note that the TRzPanel also keeps track if any its controls are already disabled when the panel is disabled. And then when the panel is re-enabled, those originally disabled controls remain disabled.

          Ray

        • #3838
          Andy Dai
          Participant

            Hi,

            “And then when the panel is re-enabled, those originally disabled controls remain disabled.”

            After i try, when panel is re-enabled, all controls in Panel will auto Enabled.

            Thanks

            • #3839
              Andy Dai
              Participant

                Hi,

                “And then when the panel is re-enabled, those originally disabled controls remain disabled.”

                After i try, when panel is re-enabled, all controls whose original state is disable in RzPanel will auto Enabled.

                Thanks.

            • #3840
              Andy Dai
              Participant

                try
                RzPanel1.Enabled:=False;
                RzButton1.Enabled:=False;
                Button1.Enabled:=False;
                finally
                RzPanel1.Enabled:=True;
                // RzButton1.Enabled and Button1.Enabled automatic become True
                end;

                But if

                try
                RzButton1.Enabled:=False;
                Button1.Enabled:=False;
                RzPanel1.Enabled:=False;
                finally
                RzPanel1.Enabled:=True;
                // RzButton1.Enabled and Button1.Enabled Still False
                end;

              • #3841
                Andy Dai
                Participant

                  i see now,

                  after RzPanel.Enable:=False , if change enable of controls will not working,
                  RzPanel Re-Enable will recovery statu of controls.

              Viewing 4 reply threads
              • You must be logged in to reply to this topic.