Using EmbedWithinPanel

How do I embed an object with a pagepanel with it resizing to the size of the pagepanel the moment it is embedded. I notice a little delay before it gets embedded. I want it to appear straight away. What is the best way of going about doing this, taking in mind I want it to be instantly at the correct position and size. If that is not possible, I at least want to be able to only make the page show up when it is ready to be seen.

Thanks

Can’t you resize it before you embed it?

Nope. I have tried using the width and height parameters for the EmbedWithinPanel function as well as setting width and height before I embed the panel. I have noticed a weird problem with sizing of controls in my app.

It might have something to do with the picture above. I do not know if this is an Xojo bug or a bug in my code but I have had this problem and used my manual work as a workaround for this problem.

Thanks btw.

https://xojo.io/03ef016dcde7

Do you have code an any Resized event? If so, is the problem that the code is being called when you don’t expect it? Or is it not being called when you do expect it?

The bug is caused by ‘me.maximize’, in first line of code in the open event. How should I go about having my window maximized by default, thanks?

After removing the code, I still get the problem of the embedded control apearing over my toolbar, which gives the effect of flickering and then is resized and position correctly. But it shows up in the wrong place for a short period.

Thanks

I think you need to look at the Screen class. In the open event all of the resizing can be programmed to happen automatically.

Thanks but I need an example to use your help??

Try this. Its very simple but I think is should do what you are trying to accomplish.

Don’t want to be rude but this is not what I am trying to do. I just want a standard maximization. And this project does not apear to use the EmbedWithinPanel or do anything of similar functionality.

Thanks for trying

The flickering seems to be a problem even without the maximize function.

I have managed to sort this problem out by setting the visible property to false and then after the embed function I set it to true.

Thanks all

what a good idea… oliver…

Thanks