We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
所有 GUI 布局都根据某些公式设置像素坐标。
我不知道有任何布局引擎与 Visual C++ 捆绑在一起,但您当然可以循环所有子窗口并根据您选择的公式定位它们。
不过,需要考虑的一件事是,布局引擎经常查询控件的“首选大小”,而本机 Windows 控件没有任何标准的报告方式。 (有
WM_GETMINMAXINFO
,但这并不完全相同。)因此,虽然自动间隔预定大小的元素相当容易,但以合理的方式自动调整大小却相当困难。All GUI layouts set the pixel coordinates, based on some formula.
I'm not aware of any layout engine bundled with Visual C++, but you certainly can loop through all child windows and position them according to a formula of your choice.
One thing to consider, though, is that layout engines often query controls for "preferred size", which native Windows controls don't have any standard way of reporting. (There is
WM_GETMINMAXINFO
, but that's not quite the same.) So while automatically spacing elements of predetermined size is fairly easy, automatically adjusting the size in a sensible way is quite a bit more difficult.