obsidian-notes/代码/动态窗口大小、居中.md
CSSC-WORK\murmur 3e6078442b init version
2024-04-15 11:19:57 +08:00

14 lines
355 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: 动态窗口大小、居中
updated: 2022-03-08 01:28:02Z
created: 2022-03-08 01:26:16Z
---
使用`setPos`可动态调整窗口大小调整前需禁用dpiscaling调整后再打开
```js
winform.enableDpiScaling(false)
winform.setPos(,,left+(w+padd)*size+left*2,top + ((w+padd)*(size+1)))
winform.enableDpiScaling()
winform.center(0)
```