C# 文本框。文本意外更改
在提交更改之前,我正在更新LINQ对象。对象属性的值取自一系列文本框 当我在一个特定的文本框中阅读时,另一个文本框会在没有明显原因的情况下更改其值C# 文本框。文本意外更改,c#,winforms,linq,linq-to-sql,C#,Winforms,Linq,Linq To Sql,在提交更改之前,我正在更新LINQ对象。对象属性的值取自一系列文本框 当我在一个特定的文本框中阅读时,另一个文本框会在没有明显原因的情况下更改其值 //... loc.Lattitude = txtLocLat.Text; // txtLocLong.Text changes to previous value loc.Longitude = txtLocLong.Text; // Which is now the previous value dc.SubmitChanges(); // ..
//...
loc.Lattitude = txtLocLat.Text; // txtLocLong.Text changes to previous value
loc.Longitude = txtLocLong.Text; // Which is now the previous value
dc.SubmitChanges();
// ...
因此,loc.Longitude永远不会随着用户输入而更新。为什么会这样
- 文本框没有数据绑定
- 文本框没有定义任何事件
- 中断到第一行只需通过DataContext的loc.latitude setter