Xojo - some pieces 4u
Windows: Monitors 3.0.1
- Read the Description
Download and try it yourself
Do you like it? Does it help you? Has it saved you time and money?
You're welcome - it's free... If you want to say thanks I appreciate a message or a small donation.
HiDPI support is a must nowadays. The Xojo Framework on TargetWindows has quite some positioning issues in a setup with multiple monitors that have different ScaleFactors.
This example Xojo project shows how to work around this by using the Windows API to position dialog windows, while falling back to the default Xojo Framework methods on other platforms.
Use the buttons on the right hand side to use the Windows API on TargetWindows.
The examples show how to:
- CenterModal: Positions a Modal Dialog in the center of the parent Window.
- FitOnMonitor: Ensures the main Window is fully visible. This is highly recommended when positioning a Window according to user preferences (e.g. restore last position), as the user's setup might have changed since you've stored the last position.
- Position a modal dialog at a relative position to the main window.
- Explicitly position a modal dialog on a relative position of a certain Monitor/Screen. That's a feature not available in the Xojo Framework.
- Explicitly position a modal dialog using Xojo's "virtual screen coordinates". That's one of the biggest issues in the Xojo Framework in a multi-monitor with multi-scalefactor situation.
How to use with your Xojo-built .app?
1. Copy the Module 'modWindowPositionFix' to your project.
2. Have a look at the example projects how to use the provided Methods. E.g.: aWindowInstance.FitOnMonitor()
back to overview
contact: Juerg Otter