如何在不调整大小的情况下更改按钮的锚点 [英] How to change anchor of button without resize

查看:103
本文介绍了如何在不调整大小的情况下更改按钮的锚点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

先生

在我的C型Winform中,
在网格控件的正下方,有一个面板添加了一个datagridview和2个按钮.

对于gridview和button我使用了anchor属性bottom.Its工作.

但是
datagrid隐藏按钮.
我希望datagrid锚点底部和按钮必须可见,但不能重新设置大小.

Sir

In my c sharp winform,
There is one panel in which i have added one datagridview and 2 button just below the grid control.

For gridview and button i have use anchor property bottom.Its working.

but
datagrid hide the button.
I want datagrid anchor bottom and button must visible but without resized

推荐答案

设置锚点,以便仅突出按钮的一侧或两侧,而不应将其突出显示彼此相对.
例如,如果将一个按钮锚定在底部"和右侧",则该按钮与表单的右下角的距离将保持相同.如果将按钮固定在底部"和左侧",则它与表单的左下角的距离将保持相同.在两种情况下,它都不会像表单一样改变大小.

锚仅在相对侧锚定后才导致控件更改大小.
Set the anchor so that only one or two sides of the button are highlighted, and these should not be opposite each other.
For example, if you anchor a button on the Bottom and Right sides, it will remain the same distance from the bottom-right corner of the form. If you anchor a button on the Bottom and Left sides, it will remain the same distance from the bottom-left corner of the form. In both cases, it will not change size as the form does.

Anchor only causes the controls to change size if opposite sides are anchored.


这篇关于如何在不调整大小的情况下更改按钮的锚点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆