简体   繁体   中英

Visual Studio Winform designer: Set DataBindings on current control BindingSource

I am creating a UserControl in Winforms, using Visual Studio 2013 designer. It contains a TextBox. I added a BindingSource (which DataSource property is set in code to a List).

在此处输入图片说明

When I click on the TextBox, look in the property window (F4), expand the "(DataBindings)" node and click on the "(Advanced)" button the Binding window opens.

在此处输入图片说明

In that window, there is no choice available in the Bindings list (beside Add). I Expected to find my BindingSource in that list.

在此处输入图片说明

Is it possible to get my custom BindingSource (added with Drag&Drop in the designer) available in that Binding window?

You have to set the DataSource property on your BindingSource control, like so:

BindingSource的

Your BindingSource control will now be available in the designer:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM