用Control.BindingContext 可以实现我要的功能, The BindingContext of a Control is used to return a single BindingManagerBase for all data-bound controls contained by the Control. The BindingManagerBase keeps all controls that are bound to the same data source synchronized. For example, setting the Position property of the BindingManagerBase specifies the item in the underlying list that all data-bound controls point to. 感谢热心朋友的回答。
我知道DataGrideview绑定后可以和datatable自动交换,而且一次可以显示多条记录。
我想要的效果是一次显示一条记录,不同的字段对应不同的Form控件,这个时候我上面提到的控件显示内容和datatable之间的交互就显得特别麻烦。
把绑定数据还有反应数据变动的处理加进去。
在画面拖增加控件,绑定数据就可以了。
代码肯定要写的。
类似于datagridview吧
The BindingContext of a Control is used to return a single BindingManagerBase for all data-bound controls contained by the Control. The BindingManagerBase keeps all controls that are bound to the same data source synchronized. For example, setting the Position property of the BindingManagerBase specifies the item in the underlying list that all data-bound controls point to.
感谢热心朋友的回答。