Note that there are some explanatory texts on larger screens.

plurals
  1. POUser control Anchor property issue
    primarykey
    data
    text
    <p><strong>Context :</strong></p> <p>I created an <code>User Control</code>. For some reason, I want to use this control in different size. To keep the initial "Template" of my <code>User Control</code> when re-sizing, I use the property <strong>Anchor</strong> on my different element inside the control. </p> <p>So when I create my control at <strong>design time</strong>, it is possible to me to <strong>hand re-size</strong> the control and keep the original "Template" of it.</p> <p>When the control is created, it look like this :</p> <p><img src="https://i.stack.imgur.com/xqK3Q.png" alt="Initial"></p> <p>And after re-size :</p> <p><img src="https://i.stack.imgur.com/p3J4A.png" alt="Re-Sized"></p> <p>As you can see, the property <strong>Anchor</strong> work well.</p> <ul> <li>The label and the picture stay in the middle.</li> <li>The "?" stay to the left corner.</li> </ul> <p><strong>The problem :</strong></p> <p>The problem I have is, when the control is reloaded, created with a different size as the initial one, all the elements inside return to their initial position :</p> <p><img src="https://i.stack.imgur.com/5D6OQ.png" alt="Problem"></p> <p>I don't know if this is the better way to do what I try to achieve. Keep in mind that I add and re-sizing the control's during the design time.</p> <p>Thank you.</p> <p><strong>EDIT :</strong></p> <p>I think my problem is caused by the designer. Ex : I add my control in the designer, I re-size it, I run the solution. All is working good. But when I go to the code of the page, and then, return to the designer, the element inside the control returned to their initial position.</p> <p><strong>EDIT 2 :</strong></p> <p>Ok I have found a solution, I simply moved all the element of the <code>User control</code> inside a <code>Panel</code>. <strong>For some reason that I can't explain</strong>, it work perfectly. The control's stay at the same location. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload