将 VB6 MSFlexGrid 升级到 VB.NET [英] Uprading VB6 MSFlexGrid to VB.NET
本文介绍了将 VB6 MSFlexGrid 升级到 VB.NET的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想将 MSFlexGrid 升级到 .net datagridview,这些代码的等效代码是什么??
I want to upgrade MSFlexGrid to .net datagridview, what is equivalent code for these code??
With gridview
If .Row > .FixedRows Then
bDoNotEdit = True
.Row = .Row - 1
bDoNotEdit = False
End If
If .Row < .Rows - 1 Then
bDoNotEdit = True
.Row = .Row + 1
bDoNotEdit = False
End If
End With
推荐答案
使用数据网格视图.
代码段假定您已经创建了一个名为SubmittedDataGridView"的 datagridview 控件并在设计时在 IDE 中创建了列,或者在您到达此处之前在运行时指定了它们.
The code segment assumes that you have created a datagridview control named "SubmittedDataGridView" and have created the columns in the IDE at design-time, or have specified them at run-time before you get here.
我不知道变量bDoNotEdit"的含义或用途,所以我忽略了它.
I do not know what the variable "bDoNotEdit" means or is used for, so I've ignored it.
'step one, create a datagridrow
Dim aRow As New System.Windows.Forms.DataGridViewRow
'Step two, create a prototypical Row from the datagridview control
aRow.CreateCells(SubmittedDataGridView)
'Step Three, specify the values
aRow.Cells(0).Value = "value one"
aRow.Cells(1).Value = "Value two"
aRow.Cells(2).Value = "value three"
'Append the row to the DataGridView
SubmittedDataGridView.Rows.Add(aRow)
这篇关于将 VB6 MSFlexGrid 升级到 VB.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文