form move with mouse

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 8 years and 3 weeks 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
User avatar
Eplerro
Posts: 5
Last visit: Thu Jul 27, 2023 10:21 pm

form move with mouse

Post by Eplerro »

Product, version and build: PowerShell Studio 2015
32 or 64 bit version of product: 64bit
Operating system: Windows 7 Enterprise
32 or 64 bit OS: 64bit

Hello,
I have a form that has "formborderstyle" set to NONE. How to make that it can be moved with the mouse around the screen.

Janusz Biel
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: form move with mouse

Post by davidc »

[POST MOVED TO THE POWERSHELL GUI FORUM BY MODERATOR]

The Form movement is handled by the Window's frame, there for if you want to move the form you will have to implement the code using the MouseMove event or create some C# code to interface with the Windows API.

Please refer to the following link:

http://stackoverflow.com/questions/1592 ... rm-movable

David
David
SAPIEN Technologies, Inc.
User avatar
Eplerro
Posts: 5
Last visit: Thu Jul 27, 2023 10:21 pm

Re: form move with mouse

Post by Eplerro »

Thank you for having responded to my question.

Janusz Biel
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: form move with mouse

Post by jvierra »

The attached psf file will demo how to make any form or control moveable via mouse capture.
Attachments
Demo-ControlTricks.psf
(20.77 KiB) Downloaded 539 times
User avatar
Eplerro
Posts: 5
Last visit: Thu Jul 27, 2023 10:21 pm

Re: form move with mouse

Post by Eplerro »

You are Great. Very, very thanks.
User avatar
rmckay9969
Posts: 63
Last visit: Fri Feb 01, 2019 6:51 pm

Re: form move with mouse

Post by rmckay9969 »

jvierra wrote:The attached psf file will demo how to make any form or control moveable via mouse capture.
Very cool stuff there, your examples never fail to amaze me.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: form move with mouse

Post by jvierra »

rmckay9969 wrote:
jvierra wrote:The attached psf file will demo how to make any form or control moveable via mouse capture.
Very cool stuff there, your examples never fail to amaze me.
Thank you. My good friend, Gandalf,taught me well.

On the serious side ... a good book on the Windows Forms will do wonders:

Exhibit 'A' - http://www.amazon.com/Professional-Wind ... 1861005547
Exhibit 'B' - http://www.amazon.com/Programming-Micro ... 0735621535
User avatar
rmckay9969
Posts: 63
Last visit: Fri Feb 01, 2019 6:51 pm

Re: form move with mouse

Post by rmckay9969 »

jvierra wrote:
rmckay9969 wrote:
jvierra wrote:The attached psf file will demo how to make any form or control moveable via mouse capture.
Very cool stuff there, your examples never fail to amaze me.
Thank you. My good friend, Gandalf,taught me well.

On the serious side ... a good book on the Windows Forms will do wonders:

Exhibit 'A' - http://www.amazon.com/Professional-Wind ... 1861005547
Exhibit 'B' - http://www.amazon.com/Programming-Micro ... 0735621535
Well, I was not disappointed with the last bit of reading advice you gave me. I will check these suggestions out as well.
This topic is 8 years and 3 weeks 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