0

I'm developing a user control consisting of two components to be used in WinForms. In order to make it convenient for user to adjust the width of both components, I want to implement the following functionality: when user drag the left boundary to resize the control, the left component changes its size, and the right component resizes when the right boundary is dragged.
Since both Resize and Move events are fired when the left boundary is dragged, I cannot simply achieve it by adding listeners to the event handlers, thus I'm wondering if there's a way to attach an event to specific user behavior in the designer, like dragging the boundary to resize or move the control.
If it proves impossible, any solution to solve the problem will also be of great help! Appreciations in advance.

Reza Aghaei
  • 120,393
  • 18
  • 203
  • 398
0x269
  • 688
  • 8
  • 20
  • 1
    If you have seen such functionality in designer, for example in split container, then it means it's possible. without having more context, code, or picture of the component, I cannot imagine what you are trying to do; I'm even not sue if you need design-time support, maybe it's just achievable using dock/anchor/layout, and etc. Anyways, you may find the following post inspiring. – Reza Aghaei Feb 18 '21 at 12:49
  • [BeginResize/EndResize Event for Control on WinForms Design Surface](https://stackoverflow.com/a/59947888/3110834) – Reza Aghaei Feb 18 '21 at 12:50
  • [UserControl with header and content - Allow dropping controls in content panel and Prevent dropping controls in header at design time](https://stackoverflow.com/a/50772584/3110834). – Reza Aghaei Feb 18 '21 at 12:52
  • @RezaAghaei Thanks a lot! I guess split container is exactly what I needed. – 0x269 Feb 18 '21 at 13:30

0 Answers0