Code Monkey home page Code Monkey logo

Comments (5)

castorix avatar castorix commented on August 11, 2024

With 1.4, I use OverlappedPresenter.SetBorderAndTitleBar(false, false)
and OverlappedPresenter.IsResizable = false (removes WS_THICKFRAME)

from microsoft-ui-xaml.

Tartarusome avatar Tartarusome commented on August 11, 2024

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.

castorix avatar castorix commented on August 11, 2024

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) :

NoCaption_Resizable

from microsoft-ui-xaml.

Tartarusome avatar Tartarusome commented on August 11, 2024

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):

NoCaption_Resizable NoCaption_Resizable

Hey bro. I just found a perfect way.It looks like the following:
image
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.

codendone avatar codendone commented on August 11, 2024

It sounds like this has been solved.

from microsoft-ui-xaml.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.