-2

I have a .net windows forms application and programming in C#. Basically, i want to have a rectangle or square object, I want the sides to be selectable and scalable. I can't find anything that I can add from the toolbox, is there anything available or any way I can do this. Every object in winforms is static and can't be selected accordingly. Please see attached image Image of rectanbleage.

Sam
  • 1
  • 2
  • You can do it yourself by checking the mouse position and using mouse events, but winform isn't the best for these kinds of tasks anyways. – John Dec 30 '20 at 22:20
  • 2
    Are you looking for something [like this](https://stackoverflow.com/a/53774101/3110834)? – Reza Aghaei Dec 30 '20 at 23:00
  • For best advice it would help to know more about the purpose. also: There is a VB shape class that might help. Other than that you'll need to write your own.. - [Here](https://stackoverflow.com/questions/52040555/creating-a-resizable-grid-to-overlay-on-a-image-using-c-sharp/52044619?r=SearchResults&s=1|37.2107#52044619) is a grid class that may be of interest for studying.. – TaW Dec 30 '20 at 23:16

1 Answers1

0

You would need to build it. Common term used is a designer user interface. I do believe there are some third-party components, but they usually are expensive and probably have way more functionality then you need in this case.

Basic concept is to store a rectangle in memory, then draw it on a form or panel. then track the users mouse and when the users mouse matches the rectangle in memory, then perform a drag operation and adjust the rectangle in memory and then re-draw.

It's not too difficult but takes time to work everything out. To build a solid designer take an extensive amount of time. Usability is the biggest obstacle.enter image description here