Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
このリンクから形状描画の記事を見つけました。描いた線がフォーム領域からはみ出さないようにチェックを入れようとしています。
これを解決するためのガイダンスに感謝します。
Containsのメソッドを使用できますRectangle。これを試して:
Contains
Rectangle
bool isLineCutOff = !(yourForm.ClientRectangle.Contains(p1) && yourForm.ClientRectangle.Contains(p2)); //p1 and p2 are 2 endpoints of your line.