Winforms DataBind可以控制控件的可见属性 [英] Winforms DataBind to Control's Visible Property

查看:102
本文介绍了Winforms DataBind可以控制控件的可见属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数据绑定到控件的可见属性时是否存在任何已知问题?

Are there any known issues when databinding to a control's visible property?

无论我的属性是什么,控件始终不可见。

The control is always NOT visible regardless of what my property is.

Public ReadOnly Property IsRibbonCategory() As Boolean
    Get
        Return True
    End Get
End Property

我尝试了控件的text属性和其他属性,它们似乎正常工作。

I tried the control's text property and other properties and they seem to work correctly.

我试图设置面板的可见属性。

I am trying to set a Panel's visible property.

推荐答案

解决方法:在BindingComplete事件上设置可见属性。

Workaround: Set the Visible property on the BindingComplete event.

设置标签的Visible属性时,我遇到了同样的问题-即使设置Enabled属性也可以正常工作。

I had same issue setting a label's Visible property - always stays false, even though setting the Enabled property works fine.

这篇关于Winforms DataBind可以控制控件的可见属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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