Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uprading VB6 MSFlexGrid to VB.NET

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
like image 944
sozai Avatar asked Jan 29 '26 13:01

sozai


1 Answers

Using a data grid view.

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.

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)
like image 112
Andrew Neely Avatar answered Feb 01 '26 13:02

Andrew Neely



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!