Wpf,我需要隐藏和显示组框吗?
如何从 xaml.cs 显示或隐藏组框。我尝试在复选框的事件中执行此操作:
private void cbDaily_Checked(object sender, RoutedEventArgs e)
{
gbCalendar.Visibility = Visibility.Visible;
}
但这不起作用。
How I can show or hide a groupbox from xaml.cs. I try to do this in the checkbox's event:
private void cbDaily_Checked(object sender, RoutedEventArgs e)
{
gbCalendar.Visibility = Visibility.Visible;
}
But this don't work.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它必须适用于复选框的选中/未选中事件,如下所示:
它在我的示例应用程序中工作正常。您能否提供有关您问题的更多详细信息,以便我有更好的想法。事件是否正确触发?确保代码后面的groupbox名称是否正确?
It must be work on checked/unchecked events of checkbox like this way :
It is working fine in my sample application. Can you please give more details of your problem, so I can have better idea. Is event fired properly ? Make sure name of groupbox in code behind is correct or not ?