如何使表格布局在 winforms 中不可见然后可见
我有一个需要打印棋盘的winform,我有一张桌子,里面有一些控件。
我所做的是在表单加载时将其设置为不可见
private void Chess_Load(object sender, EventArgs e)
{
PromotionTable.Visible =false;
}
,然后在触发函数后使其可见。
public void piecePromotionChange(Pieces[,] pieces, int rowEnd2, int columnEnd2, bool blackOrNot)
{
PromotionTable.Visible = true;
}
但它仍然存在,看不见:(
i have a winform that needs to print a chessboard, i have a table with some controls in it.
what i did was to set it invisible when the form loads
private void Chess_Load(object sender, EventArgs e)
{
PromotionTable.Visible =false;
}
and then make it visible once the function is triggered.
public void piecePromotionChange(Pieces[,] pieces, int rowEnd2, int columnEnd2, bool blackOrNot)
{
PromotionTable.Visible = true;
}
but it still remains, invisible :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要使屏幕的该部分无效/刷新。设置 Visible 属性不会触发重绘。
You'll need to invalidate/refresh that portion of the screen. Setting the Visible property does not trigger a redraw..
您可能需要在加载时将其可见性设置为
false
如果它一开始不可见,您可能需要检查并确保将其添加到控件中。
You probably ment to set its visibility to
false
on loadIf its not visible to begin with, you might need to check and make sure its added to the controls.