c# - How to check drawn line doesn't go outside of form area? -


i found shape drawing article this link. trying add check drawn line doesn't go outside of form area.

appreciate guidance in resolving this.

you can use contains method of rectangle. try this:

bool islinecutoff = !(yourform.clientrectangle.contains(p1) &&                       yourform.clientrectangle.contains(p2)); //p1 , p2 2 endpoints of line. 

Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -