locked
Resizing window - which side is pulled? (Yuri Usenko) - 1/16/2007 4:44 PM PST RRS feed

  • Question

  • By: Yuri Usenko

    Hi!
    How can I know which side (or corner) is been pulled when a window is been 
    resized? And to which direction, if possible.
    I'm trying to make a window with fixed width/height ratio (stein already 
    posted similar question). Making a window's background transparent and proper 
    resizing, say, a Grid in it helps - but I must know the direction of 
    resizing. Seems there is no PreviousValue availiable for that case, opposite 
    to mouse events
    Thanks!
    -- 
    Yuri Usenko
    Tuesday, February 19, 2008 7:38 PM

Answers

  • By: Lingesh Palaniappan (MS)

    Hi,
    There is a SizeChanged Event in window. Add an event handler to it in blend.
    The event handler should have SizeChangedEventArgs as one of its parameters.
    This has 2 properties NewSize and PreviousSize from which you can do some
    calculations to get the direction of move.
    Is that what you want? Feel free to get back to us with further questions!
    Thanks!
    regards,
    Lingesh

    --
    This posting is provided "AS IS" with no warranties, and confers no rights.
    "Yuri Usenko" <YuriUsenko@discussions.microsoft.com> wrote in message
    news:0DDD0346-85CD-4C0B-B9D2-D5608AE2C8F6@microsoft.com...
    > Hi!
    > How can I know which side (or corner) is been pulled when a window is been
    > resized? And to which direction, if possible.
    > I'm trying to make a window with fixed width/height ratio (stein already
    > posted similar question). Making a window's background transparent and
    > proper
    > resizing, say, a Grid in it helps - but I must know the direction of
    > resizing. Seems there is no PreviousValue availiable for that case,
    > opposite
    > to mouse events
    > Thanks!
    > --
    > Yuri Usenko
    Tuesday, February 19, 2008 10:32 PM

All replies

  • By: Lingesh Palaniappan (MS)

    Hi,
    There is a SizeChanged Event in window. Add an event handler to it in blend.
    The event handler should have SizeChangedEventArgs as one of its parameters.
    This has 2 properties NewSize and PreviousSize from which you can do some
    calculations to get the direction of move.
    Is that what you want? Feel free to get back to us with further questions!
    Thanks!
    regards,
    Lingesh

    --
    This posting is provided "AS IS" with no warranties, and confers no rights.
    "Yuri Usenko" <YuriUsenko@discussions.microsoft.com> wrote in message
    news:0DDD0346-85CD-4C0B-B9D2-D5608AE2C8F6@microsoft.com...
    > Hi!
    > How can I know which side (or corner) is been pulled when a window is been
    > resized? And to which direction, if possible.
    > I'm trying to make a window with fixed width/height ratio (stein already
    > posted similar question). Making a window's background transparent and
    > proper
    > resizing, say, a Grid in it helps - but I must know the direction of
    > resizing. Seems there is no PreviousValue availiable for that case,
    > opposite
    > to mouse events
    > Thanks!
    > --
    > Yuri Usenko
    Tuesday, February 19, 2008 10:32 PM
  • By: Yuri Usenko

    Thanks Lingesh, it's OK now!

    Yuri
    Tuesday, February 19, 2008 10:33 PM