Relocate child form after opening and resizing

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 1 year and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Relocate child form after opening and resizing

Post by jvierra »

gitpowershelluser wrote: Thu May 05, 2022 6:28 pm Why are you being rude? You know nothing about me.
Did you even read the part where I solved my own problem, or did you just sleep through that? What about the part where I said I've read your posts and tried to show appreciation?
I am not being rude. I am just noting that your method doesn't work correctly, and you said you wanted it to work on all screens. I am trying to get you to see and try to understand how Windows works, but you want to guess. I can't change that.

You found a guess that worked. It won't work on every screen.
gitpowershelluser
Posts: 24
Last visit: Mon Feb 06, 2023 11:30 am
Has voted: 1 time

Re: Relocate child form after opening and resizing

Post by gitpowershelluser »

Then what’s wrong?
  1. #Move the form after resize
  2. $p = $Bannerlabel.Parent.PointToScreen($Bannerlabel.location)
  3. $childform.Location = "$($p.x+110),$($p.y+30)"
This topic is 1 year and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked