Comments (5)
With 1.4, I use OverlappedPresenter.SetBorderAndTitleBar(false, false)
and OverlappedPresenter.IsResizable = false (removes WS_THICKFRAME)
from microsoft-ui-xaml.
With 1.4, I use OverlappedPresenter.SetBorderAndTitleBar(false, false)在 1.4 中,我使用 OverlappedPresenter.SetBorderAndTitleBar(false, false) and OverlappedPresenter.IsResizable = false (removes WS_THICKFRAME)和 OverlappedPresenter.IsResizable = false(删除WS_THICKFRAME)
It works on 1.5.4 too, but how can I resize the window?Must I create a small triangle in the corner by myself?
from microsoft-ui-xaml.
It works on 1.5.4 too, but how can I resize the window?Must I create a small triangle in the corner by myself?
A way is to let it resizable and subclass it (SetWindowSubclass) to handle WM_NCCALCSIZE (mainly to increment the first RECT.top to reduce the size of top border)
I tested on Windows 10 and I had to increment left and decrement right and bottom too (quick test with random values, should be calculated with APIs like AdjustWindowRect...) and set lParam to -1 in WM_NCACTIVATE, as MSDN says... and also SetWindowPos in Activated event for the first time the window is displayed) :
from microsoft-ui-xaml.
It works on 1.5.4 too, but how can I resize the window?Must I create a small triangle in the corner by myself?它也适用于 1.5.4,但是如何调整窗口大小?我必须自己在角落里创建一个小三角形吗?
A way is to let it resizable and subclass it (SetWindowSubclass) to handle WM_NCCALCSIZE (mainly to increment the first RECT.top to reduce the size of top border)一种方法是让它可调整大小并对其进行子类化 (SetWindowSubclass) 以处理WM_NCCALCSIZE(主要是增加第一个 RECT.top 以减小顶部边框的大小) I tested on Windows 10 and I had to increment left and decrement right and bottom too (quick test with random values, should be calculated with APIs like AdjustWindowRect...) and set lParam to -1 in WM_NCACTIVATE, as MSDN says... and also SetWindowPos in Activated event for the first time the window is displayed) :我在 Windows 10 上进行了测试,我也必须向左递增,向右递减右键和下键(使用随机值进行快速测试,应该使用 AdjustWindowRect 等 API 进行计算...)并在 WM_NCACTIVATE 年将 lParam 设置为 -1,正如 MSDN 所说......以及首次显示窗口时激活事件中的 SetWindowPos):
Hey bro. I just found a perfect way.It looks like the following:
This code would totally hide the title bar and the three caption buttons, but preserve a 32 or maybe 48 px rectangle overlay that is draggable and transparent.And you can use SetTitleBar(rootGrid); and set it to be interactive, then you can pretend the rootGrid is the content of a no-titlebar-window.
MS Learn Document
Here is the code.
public DockWindow() { this.InitializeComponent(); ExtendsContentIntoTitleBar = true; SetTitleBar(Part_TitleBar); var TestTitleBar = AppWindow.TitleBar; **TestTitleBar.PreferredHeightOption = TitleBarHeightOption.Collapsed;** }
from microsoft-ui-xaml.
It sounds like this has been solved.
from microsoft-ui-xaml.
Related Issues (20)
- Window close button does not fill with main window HOT 5
- WinUI: Popup shows underneath AutoSuggestBox results flyout
- Proposal:About the ComboBox can't Fuzzy search
- Dependency version conflict after switching to .net 8.
- `DependencyProperty.GetMetadata` doesn't handle custom types correctly
- WebView2 Native AOT bug
- Button menu flyout in `MediaTransportControls` is invisible HOT 1
- GetAlphaMask() visual empty for Path HOT 1
- Unable to open Split-Button flyout within a ListView using ALT + Down on the keyboard
- Tapped event is also fired by the middle, back, and forward mouse buttons
- ProgressRing is not visible on Windows 11 inside the ContentDialog HOT 1
- Modify low DPI, white border appears at the top of the window HOT 1
- Calling ItemsView.StartBringItemIntoView() Freezes The WinUI3 App
- XamlControlsResources app crash 1.6 HOT 6
- About the ComboBox can't Fuzzy search HOT 2
- Audio track flyout from `MediaTransportControls` still has transparent background
- Why not provide a window size limit property in AppWindow?
- Build errors when using "dotnet build" HOT 2
- Window objects do not deregister event handlers added via XAML or implicitly by using x:Bind, leading to memory leaks HOT 4
- If the ItemsView scrolls the scrollbar, the memory of the item will not be released. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from microsoft-ui-xaml.