How To Create control container user control

Babu R 81 Reputation points
2020-07-30T06:22:56.767+00:00

Hai

I want to create a user control for adding control container ie. after adding this control on a from I want to add controls like button etc on the rectangle region from ToolBox. The rectangle region should be control container.

I want to add controls from ToolBox on this control after adding control on a form. Here in the green Rectangle region. Please help how to achieve this.
I have attached my code 14309-my-code.txt

Thanks

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,691 questions
{count} votes

Accepted answer
  1. Andy ONeill 361 Reputation points
    2020-08-01T15:05:54.1+00:00

    Have you considered just using a Canvas?

    The canvas control does not clip. Which means you can add a child uielement to it and set canvas.Left and Canvas.Top on that to negative numbers. The uielement will appear outside the canvas. It is this mechanism I rely on for drag and drop of units in our scenario editor.

    In the picture F2LLLvU.jpg

    The user may drag units from the treeview list to the left onto the map right. The low opacity ones are already "on" the map.

    The drag process adds a PieceView ( representation of the unit as you see on the map ) to the map canvas positioned where the mouse is and it is then moved to follow the mouse position until the user releases the mouse.

    Is this the sort of functionality you had in mind?

    Will there be just one or potentially many controls dragged onto the panel?

    And they're positioned around on the panel?

    Not just in one place?

    The latter could mean your parent thing could just be a contentcontrol.

    0 comments No comments

0 additional answers

Sort by: Most helpful