|
-
Jan 8th, 2023, 09:34 PM
#1
Thread Starter
PowerPoster
Loading a form on the same screen / monitor as main form?
Hi there folks. I was getting into extended monitor set ups, and had a program written years ago with lots of forms. I was wondering, if I wanted to run a program on screen 2, and then have all forms run on screen 2, is there a code that tells the program to run on the same screen as the main form?
Thanks!
-
Jan 8th, 2023, 09:57 PM
#2
Re: Loading a form on the same screen / monitor as main form?
Where on the monitor?
The easiest way is probably to use StartupPosition = CenterOwner and of course assign the owner when the parent Form calls Load.
But a lot of people write pachinko machine programs where a raft of Forms have no hierarchical relationships, so that won't help.
You can also assign Left and Top of the loaded Form to that of the current Form before calling Load.
Or to get fancier than that you can always look at the many threads here on enumerating the list of monitors and their attributes,.
-
Jan 8th, 2023, 10:02 PM
#3
Re: Loading a form on the same screen / monitor as main form?
Here's stuff I've written to do this type of thing. It's not exactly what you asked for, but all the tools are there to get it done.
Any software I post in these forums written by me is provided "AS IS" without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. To all, peace and happiness.
-
Jan 8th, 2023, 10:06 PM
#4
Addicted Member
Re: Loading a form on the same screen / monitor as main form?
There is an API that will tell you which "device" a pointer or form is located. However, the easiest way would be to start any "virgin window" in the middle of your own programs RECT location.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|