locked
How to check the position of an Element via C# code RRS feed

  • Question

  • Hey,

    I have programmed a button that adds TextBoxes underneath each other and want the button to stop adding once they are close to the bottom of the app. Can anyone show me how that is done? Another thing I'd like to know is how to make the "MainGrid" that is provided by default scroll up and down/ left and right once something reaches its borders.

    Thank you very much!

    Gewwtings

    FunkyPeanut

    (I dunno why the font-size shrinked like that)  

    Saturday, September 14, 2013 12:13 PM

Answers

  • Hi Funky Peanut,

    For your first question: Take a look at Margin property of an Element, you could use Margin.Bottom to know if the control is close to the bottom of the container.

    The second question, I'm not sure if I get what you mean, you mean while the mouse(for instance) move to the bottom of the scrollviewer, it automatically scroll down? I think it can be possible but should be a difficult work, how to handle the event to be fired is the question. Or track the pointer(mouse,touch) and get the current position to compare with the item borders' position.

    By the way, the forum reply is using a HTML format, you can click "HTML" tag in the editbox to modify your text font.

    Best Regards,

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.


    Monday, September 16, 2013 1:38 AM
    Moderator