keep mouse cursor inside a form or control in visual basic

The following Visual Basic project contains the source code and Visual Basic examples used for keep mouse cursor inside a form or control. Pass the hWnd property of the form or control to this function, and you won't be able to move the mouse outside of it.
The source code and files included in this project are listed in the project files section, please make sure whether the listed source code meet your needs there.

Project Files: 

File NameSize