HOWTO: Drag a Form by a Child Control (in .net) |
| | | | Submitted on: 11/7/2003 9:21:46 AM
By: George Vlahakis
Level: Beginner User Rating: Unrated Compatibility:VB.NET
Users have accessed this article 215 times. | |
| | Very simple translation of how to drag a form with no caption bar in .net . Based on the old Q154006 from the Knoweldgebase. | |
|
Terms of Agreement:
By using this article, you agree to the following terms...
1) You may use
this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
2) You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.
3) You may link to this article from another website, but ONLY if it is not wrapped in a frame.
4) You will abide by any additional copyright restrictions which the author may have placed in the article or article's description. | Nothing great really but might save some time for those out there trying to do this.
So if you want to allow the user to drag a form by clicking on the form itself you can use this code.
It is based on Q154006 from the Knowledgebase, no rocket science really.
If there are other better ways please let me know.
Here is the code to put in your Form_OnMouseDown event:
Dim msg As New Message
Const WM_SYSCOMMAND = &H112;
Const MOUSE_MOVE = &HF012;
msg.HWnd = Me.Handle
msg.Msg = WM_SYSCOMMAND
msg.WParam = New IntPtr(MOUSE_MOVE)
Me.Capture = False
Call Me.WndProc(msg)
| |
|
Report Bad Submission |
|
|
Your Vote! |
See Voting Log |
|
Other User Comments |
There are no comments on this submission. |
|
Add Your Feedback! |
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.
NOTICE: The author of this article has been kind enough to share it with you. If you have a criticism, please state it politely or it will be deleted.
For feedback not related to this particular article, please click here. |
|