Web Apps - centering content

Hi all, just a very quick question before I (attempt to) convert a desktop app to a web app - is there a way to centre content within the web browsers window without having to put everything in to a container (I did it this way for a small project some years ago and it was a royal pain in the a**, even with only a small number of pages, this app will have hundreds!)… many thanks, Dave.

move the item in the center of the IDE until you see some purple vertical or horizontal line and stick to them.
they will center in the browser window.

This works for a single control - but, for example, if you put a picture on a canvas and move it to the top left of the canvas and then centre that canvas - the picture becomes detached which is contrary to what happens in a desktop app…

I think you can use WebRectangle controls for that. Drop them centered in the page, remove the anchors and drop controls inside of it.

You just have to remove the border color in the Opening event, to make them transparent:

Me.Style.BorderColor = Color.Clear

That said, I still prefer Container Controls.

1 Like

Thanks Ricardo!

1 Like

No prob David!