简体   繁体   English

如何将自动生成的 ID 号复制到文本框?

[英]how to copy an auto generated id number to a textbox?

im trying to figure out a way to copy the auto generated "BOM No" into another textbox "Schedule No", the problem is that the value of "BOM No:" when adding a new record is set to "New" and is only assigned a BOM number when saving the record.我试图找出一种方法将自动生成的“BOM No”复制到另一个文本框“Schedule No”中,问题是添加新记录时“BOM No:”的值设置为“New”并且仅保存记录时分配了一个 BOM 编号。

I would like to find a method that would allow me to equal the value of BOM No to Schedule No so that i could use it as an identifier when loading BOM Records accodring to BOM No = Schedule No我想找到一种方法,可以让我将 BOM No 的值等于 Schedule No,以便在根据 BOM No = Schedule No 加载 BOM 记录时将其用作标识符

Any help would be much appreciated :)任何帮助将非常感激 :)

BOM 编号:= 自动生成的 ID

I would do something like this.我会做这样的事情。 Have a property on the form/window (whatever it is) and when the BOM number is set, that property should be set with the value of the BOM number.在窗体/窗口上有一个属性(无论它是什么),当设置了 BOM 编号时,该属性应该设置为 BOM 编号的值。

Then, bind both TextBox controls (not sure whether you are using WPF or Winforms) to that property.然后,将两个 TextBox 控件(不确定您使用的是 WPF 还是 Winforms)绑定到该属性。 Both technologies can do such bindings.这两种技术都可以进行这样的绑定。

Hope that helps.希望有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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