In the current implementation AdvSpinEdit uses SetVisible (and not VisibleChanging) to set the visibility of its attached label. Since SetVisible is not an override method it will not work if you use a base class (like TControl) in order to set the visibility.

Currently we are using a frame with multiple components which visibility states must be change dynamically. For this purpose all relevant components are grouped within arrays of TControl which bundle them into corresponding groups. If you iterarte over these controls in order to change their visibility this bug will surface. Currently we are using a workaround to explicitly cast any control to TAdvSpinEdit if it is of this type.

Could this be fixed? Thanks in advance and best regards,
P. Schäfer

I could not reproduce this. Test code on form with TAdvSpinEdit with Label shown:

procedure TForm1.Button1Click(Sender: TObject);
  i: integer;
  for I := 0 to ControlCount - 1 do
    if not (Controls[i] is TButton) then
      Controls[i].Visible := not Controls[i].Visible;

This code toggles label + spin edit visibility.

With this loop you should also directly toggle the visibility of the TLabel which the TAdvSpinEdit creates internally, should it not?

That said, if I reduce the code to a minimial example I could no longer observe my issue. It turns out, that while SetVisible is indeed never called the CMShowingChanged-Method sets the visibility of the label correctly. I overlooked this in the code. For some reasons I still have to investigate, the windows message is not processed in the real project. This is the real cause of the issue. Sorry for the bother.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.