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
Post a Comment