Support Forums

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.
User avatar
Eplerro
Posts: 3
Joined: Thu Jul 09, 2015 5:28 am

form move with mouse

Postby Eplerro » Tue Feb 09, 2016 5:57 am

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: 4452
Joined: Thu Aug 18, 2011 4:56 am

Re: form move with mouse

Postby davidc » Tue Feb 09, 2016 9:21 am

[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: 3
Joined: Thu Jul 09, 2015 5:28 am

Re: form move with mouse

Postby Eplerro » Tue Feb 09, 2016 10:42 pm

Thank you for having responded to my question.

Janusz Biel
User avatar
jvierra
Posts: 10026
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: form move with mouse

Postby jvierra » Fri Feb 12, 2016 4:23 pm

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 133 times
User avatar
Eplerro
Posts: 3
Joined: Thu Jul 09, 2015 5:28 am

Re: form move with mouse

Postby Eplerro » Mon Feb 22, 2016 12:32 am

You are Great. Very, very thanks.
User avatar
rmckay9969
Posts: 51
Joined: Fri Oct 30, 2015 4:24 pm

Re: form move with mouse

Postby rmckay9969 » Sun Mar 06, 2016 5:56 pm

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.
User avatar
jvierra
Posts: 10026
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: form move with mouse

Postby jvierra » Sun Mar 06, 2016 6:13 pm

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: 51
Joined: Fri Oct 30, 2015 4:24 pm

Re: form move with mouse

Postby rmckay9969 » Sun Mar 06, 2016 9:26 pm

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.

Return to “PowerShell GUIs”

Who is online

Users browsing this forum: No registered users and 1 guest