gpt4 book ai didi

c# - 如何在 C# 中将 Dim 代码编写为 New System.Windows.Forms.Binding ("text", Me.bindingSource1, "ATMCode", True)

转载 作者:行者123 更新时间:2023-11-30 14:59:06 24 4
gpt4 key购买 nike

大家好,如何用 C# 编写这个 VB 源代码

Dim codes As New System.Windows.Forms.Binding("text", Me.bindingSource1, "ATMCode", True)

我试写了

int codes = new Binding("text", this.bindingSource1, "ATMCode", True);

但是 VS 说错误 Cannot implicitly convert type 'System.Windows.Forms.Binding' to 'int'

最佳答案

var codes = new Binding("text", this.bindingSource1, "ATMCode", true);

上面代码的问题是它是 Binding 而不是 Int。

就像罗伯特说的,你也可以把它写成...

Binding codes = new Binding("text", this.bindingSource1, "ATMCode", true);

如果您来自 VB,这可能不会造成混淆。

关于c# - 如何在 C# 中将 Dim 代码编写为 New System.Windows.Forms.Binding ("text", Me.bindingSource1, "ATMCode", True),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17307810/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com