gpt4 book ai didi

c# - 为什么 CheckedListBox 的数据绑定(bind)是 "Hidden"?

转载 作者:太空狗 更新时间:2023-10-30 01:12:04 25 4
gpt4 key购买 nike

CheckedListBox 上的 DataSource 属性对 Intellisense 是隐藏的。为什么?您可以使用绑定(bind)属性使其工作,但我担心它出于某种原因被隐藏,并且出于我不知道的某些重要原因我不应该在 CheckedListBox 上进行数据绑定(bind)。

CheckedListBox 上的数据绑定(bind)可以吗??

最佳答案

CheckedListBox旨在与其 Add 一起使用和 AddRange方法:

To add objects to the list at run time, assign an array of object references with the AddRange method. The list then displays the default string value for each object. You can add individual items to the list with the Add method.

虽然数据绑定(bind)到 CheckedListBox 可能有效,但您应该避免创建对类型公共(public)接口(interface)之外的任何内容的依赖。我建议您使用正确的方法,因为如果 Microsoft 更改了 CheckedListBox 的实现,这将使您的代码不那么脆弱。

关于c# - 为什么 CheckedListBox 的数据绑定(bind)是 "Hidden"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1346686/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com