How To Drag a Form by a Child Control (154006)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
- Microsoft Visual Basic Standard Edition for Windows 4.0
- Microsoft Visual Basic Professional Edition for Windows 4.0
- Microsoft Visual Basic Enterprise Edition for Windows 4.0
This article was previously published under Q154006 SUMMARY
A window can be moved by clicking the Title bar and then dragging the
window to the required position. This technique will not work if the window
doesn't have a Title bar. Using the SendMessage API, you can achieve this
effect by dragging a control on the form and the form will move with the
control. Below is a code sample showing how to accomplish this.
REFERENCES
For more information, please see the following articles in the Microsoft
Knowledge Base:
103062 How to Move Controls at Run Time By Using Drag and Drop
113904 How to Move a Control Across a Form at Run Time
79884 How to Move Controls Between Forms in VB for Windows
Modification Type: | Minor | Last Reviewed: | 7/1/2004 |
---|
Keywords: | kbhowto KB154006 |
---|
|