【发布时间】:2019-09-27 17:38:03
【问题描述】:
所以我有类'employee',其中有属性double X 和double Y,我想将这两个绑定到表单的位置。 (左上角)我尝试过使用How to get the position of a Windows Form on the screen?
但它只给出无用的值。
如何访问实际属性?
目前已经尝试过:
this.Left.DataBindings.Add("Value", EmpNd, "ThisEmployee.X", true, DataSourceUpdateMode.OnValidation);
【问题讨论】:
-
请先展示你的作品。
-
@Sach 我应该显示什么?我有一个表单和一个类,在类中,我想使用
DataBindings.Add方法将 x 和 y 属性绑定到表单。 -
所以你的代码。展示您迄今为止尝试过的内容。
-
@Sach 添加了你想要的内容
-
您应该按照此处的建议创建一个 MCVE:stackoverflow.com/help/minimal-reproducible-example
标签: c# forms winforms data-binding properties