Answer the question
In order to leave comments, you need to log in
How to make/draw controls in Windows Forms to resize an object?
I'm slowly getting to know Windows Forms and ran into a problem.
For a better understanding, let's assume that there is an image in the program window that the user can resize. And I want to implement this with the help of controls (sliders, draggers, xs how to do it right), as in the editor itself (example in the picture).
Those. the logic is as follows: the user clicks on the picture, these controls appear, the user changes the size of the picture with their help, pokes in an empty space and the controls disappear.
How can I do that? You need to somehow draw dotted lines, buttons at the corners and sides, I don’t understand at all.
Answer the question
In order to leave comments, you need to log in
I found such a thing
Simple Runtime Control Sizing and Dragging Class
Connect the file to the project, send the element to which you want to add controls to the WireControl.
And that's it, now when you click on this element, you can drag and resize it.
You create small panels on top of all elements. Each panel is responsible for its own action. The dotted line is the frame of your picture. More precisely, the container that contains the image.
create one panel, throw the "edit" buttons on it (change the size, color). To work with images there is a PictureBox component, add it to the form. when you click on it (focus), you can show a panel with "tools", when you lose "focus", i.e. when clicking on other elements, you can hide the panel with "tools"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question