C
C#2y ago
Pdawg

✅ How do I move a Window in WinUI 3 C#?

Hey everyone! I have a window that is shaped like a taskbar, so it's {screenWidth} x 50px tall. Currently upon launching the app, it goes to the top of my screen. How can I reposition the window to the bottom while keeping its size?
4 Replies
Jester
Jester2y ago
didnt you code it to be at the top of your screen?
Jester
Jester2y ago
idk if there is a winui3 specific function but i think this should work just fine. pinvoke it and read the docs well https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setwindowpos
SetWindowPos function (winuser.h) - Win32 apps
Changes the size, position, and Z order of a child, pop-up, or top-level window. These windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and is the first window in the Z order.
sibber
sibber2y ago
youd have to pinvoke yeah
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.