Visual Studio Winform 设计器:在当前控件 BindingSource 上设置 DataBindings

2023-12-09

我正在使用 Visual Studio 2013 设计器在 Winforms 中创建 UserControl。它包含一个文本框。我添加了一个 BindingSource(其 DataSource 属性在代码中设置为列表)。

enter image description here

当我单击文本框时,查看属性窗口 (F4),展开“(DataBindings)”节点,然后单击“绑定”窗口打开的“(高级)”按钮。

enter image description here

在该窗口中,“绑定”列表中没有可用的选项(“添加”旁边)。我希望在该列表中找到我的 BindingSource。

enter image description here

是否可以在该绑定窗口中获取我的自定义 BindingSource(通过设计器中的拖放添加)?


您必须在 BindingSource 控件上设置 DataSource 属性,如下所示:

BindingSource

您的 BindingSource 控件现在将在设计器中可用:

enter image description here

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Visual Studio Winform 设计器:在当前控件 BindingSource 上设置 DataBindings 的相关文章

随机推荐