locked
Display WPF Window on the top right corner of the screen. RRS feed

  • Question

  • I am working on an application in which the user can select the position(Top-Right, Top-Left, Bottom-Right & Bottom-Left) where the window should be displayed on the screen.
    Please suggest how can I achieve this?
    Wednesday, January 20, 2010 9:49 AM

Answers

  • Try using the Window's Top and Left properties:

    i.e. right upper corner would be:
    this -> the Window object
    
    this.Top=0;
    this.Left=SystemParameters.PrimaryScreenWidth-this.Width;
    hope that helped
    trust is a weakness, betrayal is the hidden blade
    • Marked as answer by PradeepYR Thursday, January 21, 2010 4:08 AM
    Wednesday, January 20, 2010 10:36 AM

All replies

  • Try using the Window's Top and Left properties:

    i.e. right upper corner would be:
    this -> the Window object
    
    this.Top=0;
    this.Left=SystemParameters.PrimaryScreenWidth-this.Width;
    hope that helped
    trust is a weakness, betrayal is the hidden blade
    • Marked as answer by PradeepYR Thursday, January 21, 2010 4:08 AM
    Wednesday, January 20, 2010 10:36 AM
  • Thanks  for your solution.

    It worked for me.
    Thursday, January 21, 2010 4:09 AM