简体   繁体   中英

Windows Forms border and form control

When I use this code to hide the windows border:

this.FormBorderStyle = FormBorderStyle.None;

I loose control of moving it around is there a way to add some code that will allow you to click and drag anywhere within the form itself?

Short answer, no. There is no such thing built-in to WinForms. You will have to add an event handler on the client area and handle the window move yourself. To avoid duplicating answers, I send you back to this post

Instead is relatively easy to do with Windows API.
We need to persuade the window manager into believing that we clicked on the caption of the window.
Look at the sample in this project

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM