Problem with ContainerControl.Resizing

Hi!

In my app I have a ContainerControl with Resizing-event. In my Window I have 3 instances of that CC. When I resize the window, the Resizing-event fires in only one of them. What could be wrong?

[quote=147940:@Thomas White]Hi!

In my app I have a ContainerControl with Resizing-event. In my Window I have 3 instances of that CC. When I resize the window, the Resizing-event fires in only one of them. What could be wrong?[/quote]

Is the event attached to the CC itself or the instances ?

I placed a label onto a CC and this code :

Sub Resized() me.Label1.text = str(me.width) End Sub

I tried with the Resized event attached to the instances, it works fine.

I tried attached to the CC itself, works fine too.

The event is in the CC itself.

I’ve also tried this in a new simplified project and it works. So there’s something special in my project, which makes finding the problem so tricky.

Now it gets even weirder.

I added Resized-event to the CC also. It fires constantly (while resizing) on the other two CC’s, but not on the one where Resizing-event works.

[quote=147954:@Thomas White]The event is in the CC itself.

I’ve also tried this in a new simplified project and it works. So there’s something special in my project, which makes finding the problem so tricky.[/quote]

Have you tried deleting a non working instance and replacing it by a new one ?

The only way I could reproduce what you describe is by using :

Sub Resized() Window1.ContainerControl11.Label1.Text = str(Window1.ContainerControl11.width) End Sub

Just tried that, unfortunately it didn’t help. Thanks for the tip, though.

I guess I’ll have to try to remove stuff one by one from the CC to see if I can find the cause.

Ok, I think I found the problem.

In my app, two of my CC are placed inside a Canvas, and one is inside a PagePanel.
The CC’s that are inside a Canvas does not fire the Resizing-event.

Bug?

Test Project: https://www.dropbox.com/s/mb2y6y20a5scn0s/Test.xojo_binary_project?dl=0

[quote=148309:@Thomas White]Ok, I think I found the problem.

In my app, two of my CC are placed inside a Canvas, and one is inside a PagePanel.
The CC’s that are inside a Canvas does not fire the Resizing-event.

Bug?

Test Project: https://www.dropbox.com/s/mb2y6y20a5scn0s/Test.xojo_binary_project?dl=0[/quote]

Looks like a bug, so you should file a bug report with the project attached.

More amazing : Resized works fine for the CC in the canvas, but not for the one on the window. In essence, you could work around the bug by using Resizing in the first one, and Resized in the second.

I only used Canvases to group controls (to animate them as a group) so I’m just gonna use PagePanels instead. That way at least the code will be correct, until or if Xojo fixes the bug.

Thanks for the help, Michel.