简体   繁体   中英

How do I set the default size of a new window in WPF?

I am creating a WPF application. All the windows I'm using are 1980x1080.

However, whenever I create a new window the default size of it is 300x300.

It is quite annoying to have to change it every time, so I am wondering if there is a way to set the default new window size.

I am using Visual Studio 2017. Thanks in advance.

You can put the size you want in the XAML file and export a new template from: File->Export Template and choose Item Template.

Then when you want to add a new window, you choose your custom template instead of the default.

More details can be found in the documentation .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM