将此代码VB.NET转换为C# [英] Convert this code VB.NET to C#
本文介绍了将此代码VB.NET转换为C#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Private Sub DataGridView1_CellLeave(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellLeave
If cbo IsNot Nothing Then
If Not String.IsNullOrWhiteSpace(cbo.Text) Then
If Not AutoList.Contains(cbo.Text) Then
Dim cb = CType(DataGridView1.Columns(0), DataGridViewComboBoxColumn)
AutoList.Add(cbo.Text)
Dim Items As List(Of String) = CType(cb.DataSource, String()).ToList
Items.Add(cbo.Text)
Dim Index = Items.FindIndex(Function(x) x.ToLower = cbo.Text.ToLower)
cb.DataSource = Items.ToArray
cbo.SelectedIndex = Index
End If
End If
End If
End Sub
我尝试了什么:
将VB.NET转换为C#
i需要转换此代码到c#请转换
Iam使用网站但不好转换
What I have tried:
convert VB.NET to C#
i need to convert this code to c# please convert
Iam using site but not good to convert
推荐答案
对不起,本网站不提供代码编写或转换服务。 VB.NET和C#足够接近你应该能够自己做。
Sorry, this site does not provide a code writing or conversion service. VB.NET and C# are close enough that you should be able to do it yourself.
这篇关于将此代码VB.NET转换为C#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文