obsidian-notes/代码/动态窗口大小、居中.md

14 lines
355 B
Markdown
Raw Normal View History

2024-04-15 03:19:57 +00:00
---
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)
```