locked
HOW DOCK FORM IN LEFT OR RIGHT EDGE OF DESKOP? RRS feed

  • Question

  • hi
     I want to dock my form in right or left edge of desktop.
    how do this?
    thanks
    Monday, September 8, 2008 11:46 AM

Answers

  • Hi Hassan,

    To dock left set the LEFT propert of window to 0.

    <Window
      x:Class="left_dock.Window1"
     x:Name="Window"
     Title="Window1"
     Width="640" Height="480" HorizontalAlignment="Left" VerticalAlignment="Top" Left="0" Top="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" WindowState="Normal">

    It is not exactly docking, but positioning.

    When the screen resolution is fixed, we can calculate manually the LEFT value, by taking into the account the width of the form, to position the form to Right.

    -BALA.

    With Regards, BALA.
    Tuesday, September 9, 2008 6:04 AM
  • There is no pure WPF/Blend way of doing this feature, you need to implement some Windows SDK function and play with Windows Handle to be able to do so.

    Here is an article related to Winform, Its should be quite easy to move to WPF

    http://www.codeproject.com/KB/dotnet/AppBar.aspx

    Tuesday, September 9, 2008 6:57 PM

All replies

  • Hi Hassan,

    To dock left set the LEFT propert of window to 0.

    <Window
      x:Class="left_dock.Window1"
     x:Name="Window"
     Title="Window1"
     Width="640" Height="480" HorizontalAlignment="Left" VerticalAlignment="Top" Left="0" Top="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" WindowState="Normal">

    It is not exactly docking, but positioning.

    When the screen resolution is fixed, we can calculate manually the LEFT value, by taking into the account the width of the form, to position the form to Right.

    -BALA.

    With Regards, BALA.
    Tuesday, September 9, 2008 6:04 AM
  • Hi BalaMurugan
    this mean don't way exist to dock form?
    if i need to my for is Always On Top how do it?
    thanks
    Tuesday, September 9, 2008 11:04 AM
  • Hi BalaMurugan
    this mean don't way exist to dock form?
    if i need to my for is Always On Top how do it?
    thanks
    Tuesday, September 9, 2008 11:05 AM
  • There is no pure WPF/Blend way of doing this feature, you need to implement some Windows SDK function and play with Windows Handle to be able to do so.

    Here is an article related to Winform, Its should be quite easy to move to WPF

    http://www.codeproject.com/KB/dotnet/AppBar.aspx

    Tuesday, September 9, 2008 6:57 PM