The distance between Left and Right side of screen is (DisplayArea.Primary.WorkArea.Width - 340)
.
move my window to Right side of screen: x+(width-340)
;
And then move my window to Left side of screen: x-(width-340)
;
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
i want to create a window in Left or Right side of a screen in winui 3
i used following codes:
var width = DisplayArea.Primary.WorkArea.Width;
var height = DisplayArea.Primary.WorkArea.Height;
var x = DisplayArea.Primary.WorkArea.X;
var y = DisplayArea.Primary.WorkArea.Y;
AppWindow.MoveAndResize(new Windows.Graphics.RectInt32
{
Height = height,
Width = 340,
X = x,
Y = y
});
i can see that my window is created in Left side of screen, but i dont know how to move my window to Right side of screen.
i tried to use:
X = x -340
but did not work if i use -
window go to left side again and for going to right i should use +
but i dont know how to calcualte currect value.
The distance between Left and Right side of screen is (DisplayArea.Primary.WorkArea.Width - 340)
.
move my window to Right side of screen: x+(width-340)
;
And then move my window to Left side of screen: x-(width-340)
;