锚属性无法正常工作

编程入门 行业动态 更新时间:2024-10-25 21:23:54
本文介绍了锚属性无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我有1个表单,并且在其中添加了用户控件..用户控件的anchor属性不起作用,我不知道它正在发生..我也在监视窗口中检查了..父''的锚点属性有效,但孩子的锚点属性无效.. 还有其他属性可以更改该属性吗?.plz帮助我.. 在此先感谢..

Hi all, i''ve 1 form and in that we are adding the user controls.. the anchor property of the user control is not working, i dont know y it is happening.. i checked in the watch window also.. the parent''s anchor property is working but the child''s anchor property is not working.. is there any other property to change that one.. plz help me.. thanks in advance..

推荐答案

避免锚点—确实会引起问题!切换到使用Dock和Padding的组合.您将获得相同的布局,但是无需使用手动定位器即可使用锚定器,并且不会出现锚定器典型的闪烁.您可能需要创建许多中间面板,但这只会提高设计的可维护性. 请在这里找到我的小代码示例: 如何停靠按钮,以便它可以使用以下格式进行调整 [ ^ ]. 另请参见: GUI外观-C#.Net [ ^ ], 屏幕分辨率改变时,Zom Out发生故障 [ ^ ].
—SA
Avoid Anchors — they do cause problems! Switch to using combination of Dock and Padding. You will get the same layout, but without manual positioning you need with Anchors and without flicker typical for Anchors. You might need to create many intermediate panel, but it only improved maintainability of your design. Please find my small code sample here: how to dock button so that it can adjust with the form[^]. See also: GUI Apperance - C#.Net[^], Zom Out malfunctions when Screen resolution changes[^].
—SA

更多推荐

锚属性无法正常工作

本文发布于:2023-11-08 08:00:31,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1568806.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:无法正常   属性   工作

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!