# Control Alignment Mac vs Windows

**URL:** <https://forum.xojo.com/t/control-alignment-mac-vs-windows/72596>\
**Category:** General\
**Created:** [October 8, 2022, 10:36pm UTC](https://forum.xojo.com/t/control-alignment-mac-vs-windows/72596 "2022-10-08T22:36:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julia\_Truchsess](https://forum.xojo.com/user_avatar/forum.xojo.com/julia_truchsess/32/499_2.png) [@Julia\_Truchsess](https://forum.xojo.com/u/Julia_Truchsess)\
**Post date:** [October 8, 2022, 10:36pm UTC](https://forum.xojo.com/t/control-alignment-mac-vs-windows/72596/1 "2022-10-08T22:36:28Z")

</div>

Recently, control alignment between Mac and Windows seems to have gone completely off the rails. I don’t know if this is the fault of new versions of the two OSs or what, but it’s a sad state of affairs and I don’t remember it being this bad in past years.

I have a simple ContainerControl with a label, a PopUpMenu, and a Canvas. The label and PopUp both use the default System font with no size specified. If I get them all lined up nicely in the vertical axis on MacOS, they are horribly misaligned under Windows, and vice-versa. Looks like time for a whole bunch of ugly #IFTARGETs ☹

Xojo 2021r2.1, MacOS Monterey, Windows 10/11.

---

<div class="post-metadata">

**Author:** ![Ian\_Kennedy](https://forum.xojo.com/user_avatar/forum.xojo.com/ian_kennedy/32/6860_2.png) [@Ian\_Kennedy](https://forum.xojo.com/u/Ian_Kennedy)\
**Post date:** [October 8, 2022, 10:38pm UTC](https://forum.xojo.com/t/control-alignment-mac-vs-windows/72596/2 "2022-10-08T22:38:49Z")

</div>

Have you an simple example, file a bug report ASAP. I feed we have a release imminent. It would be a shame to have something so wrong released. Happy to sign on, if I can reproduce.

I’ve a new crash that’s not getting much love, if you can verify:

[https://tracker.xojo.com/xojoinc/xojo/-/issues/69880](https://tracker.xojo.com/xojoinc/xojo/-/issues/69880)

---

<div class="post-metadata">

**Author:** ![Julia\_Truchsess](https://forum.xojo.com/user_avatar/forum.xojo.com/julia_truchsess/32/499_2.png) [@Julia\_Truchsess](https://forum.xojo.com/u/Julia_Truchsess)\
**Post date:** [October 8, 2022, 10:45pm UTC](https://forum.xojo.com/t/control-alignment-mac-vs-windows/72596/3 "2022-10-08T22:45:15Z")

</div>

It would involve some time and effort to make an example app, but here’s the result:

Mac:

 ![Screen Shot 2022-10-08 at 6.43.54 PM](https://forum.xojo.com/uploads/default/original/2X/5/550c1feee22c619fe601f87358eb9026fe04bae4.png)

Win:

 ![Screen Shot 2022-10-08 at 6.42.52 PM](https://forum.xojo.com/uploads/default/original/2X/9/987f83b428cdcddc60cded805bab40743731d521.png)

---

<div class="post-metadata">

**Author:** ![Ian\_Kennedy](https://forum.xojo.com/user_avatar/forum.xojo.com/ian_kennedy/32/6860_2.png) [@Ian\_Kennedy](https://forum.xojo.com/u/Ian_Kennedy)\
**Post date:** [October 9, 2022, 10:08am UTC](https://forum.xojo.com/t/control-alignment-mac-vs-windows/72596/4 "2022-10-09T10:08:12Z")

</div>

Are they just laid out in the Window editor or are you using code to move them.

---

<div class="post-metadata">

**Author:** ![Julia\_Truchsess](https://forum.xojo.com/user_avatar/forum.xojo.com/julia_truchsess/32/499_2.png) [@Julia\_Truchsess](https://forum.xojo.com/u/Julia_Truchsess)\
**Post date:** [October 9, 2022, 12:49pm UTC](https://forum.xojo.com/t/control-alignment-mac-vs-windows/72596/5 "2022-10-09T12:49:20Z")

</div>

Just laid out in the IDE, no control moving in code. The ContainerControl is embedded in another ContainerControl at runtime.

---

<div class="post-metadata">

**Author:** ![Julia\_Truchsess](https://forum.xojo.com/user_avatar/forum.xojo.com/julia_truchsess/32/499_2.png) [@Julia\_Truchsess](https://forum.xojo.com/u/Julia_Truchsess)\
**Post date:** [October 9, 2022, 1:25pm UTC](https://forum.xojo.com/t/control-alignment-mac-vs-windows/72596/6 "2022-10-09T13:25:04Z")

</div>

Moving the PopupMenu down 8 points under Windows restores alignment pretty well. FWIW, the Popup’s height is 30 rather than the default of 20, but when I make it 20 the cross-platform alignment is still off.

---

<div class="post-metadata">

**Author:** ![Greg\_O](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o/32/22785_2.png) [@Greg\_O](https://forum.xojo.com/u/Greg_O)\
**Post date:** [October 9, 2022, 1:37pm UTC](https://forum.xojo.com/t/control-alignment-mac-vs-windows/72596/7 "2022-10-09T13:37:48Z")

</div>

I worked on this at one point and found that running the same app on multiple versions of macOS and Windows resulted in different alignments in almost all cases. Apple certainly assumes that you’re using baseline constraints (which Xojo does not) and Windows… the only way I was ever able to get things right was to eyeball it.

It should be possible to create a method that you’d run on a window or container that would make th we adjustments for you, but it would have to be Xojo-version specific as they’ve made adjustments over the years.

---

<div class="post-metadata">

**Author:** ![Julia\_Truchsess](https://forum.xojo.com/user_avatar/forum.xojo.com/julia_truchsess/32/499_2.png) [@Julia\_Truchsess](https://forum.xojo.com/u/Julia_Truchsess)\
**Post date:** [October 9, 2022, 1:54pm UTC](https://forum.xojo.com/t/control-alignment-mac-vs-windows/72596/8 "2022-10-09T13:54:32Z")

</div>

> [@Greg\_O](#):
>
> It should be possible to create a method that you’d run on a window or container that would make th we adjustments for you

Thanks for the confirmation. I just tweak the Top properties now in the container’s Open event using #If Target - it works but is annoying to have to do.
