Yet again, more fantastic VB6 to VB.NET migration.
Okay sure, this isn't necessarily a "Question" in definition, but it will answer many questions that users will have in the future, and will hopefully answer my questions as well.
I am trying to compile a list of properties and functions within MSFlexGrid
in VB6/VBA and .NET's DataGridView
that provide the same or somewhat same uses. Not only do I need them, but I am sure there are more who do.
So far this is what I have, and I would like others to feel free to add and edit as you please. I hoping this helps me and others convert old controls into .NET controls with the same functionality as in their old code. If you feel like adding, please enter the relation in the BlockQuote and the definition in its proprietary place:
VB6/VBA VB.NET MSFlexGrid.Cols ::::: DataGridView.ColumnCount MSFlexGrid.Col ::::: ??? MSFlexGrid.Rows ::::: DataGridView.RowCount MSFlexGrid.Row ::::: ??? MSFlexGrid.TextMatrix ::::: DataGridView.Item(Int32,Int32).Value MSFlexGrid.TextArray ::::: ??? Add More Here ::::: Add More Here
Definitions VB6:
MSFlexGrid.Cols = Returns or sets the total number of columns in an MSFlexGrid.
MSFlexGrid.Col = Returns or sets the coordinates of the active cell in an MSFlexGrid.
MSFlexGrid.Rows = Returns or sets the total number of rows in an MSFlexGrid.
MSFlexGrid.Row = Returns or sets the coordinates of the active cell in an MSFlexGrid.
MSFlexGrid.TextMatrix = Returns or sets the text contents of an arbitrary cell. This property allows you to set or retrieve the contents of a cell without changing the Row and Col properties
MSFlexGrid.TextArray = Returns or sets the text content of an arbitrary cell. This property allows you to set or retrieve the contents of a cell without changing the Row and Col properties.
Add More Here
Definitions VB.NET:
DataGridView.ColumnCount = Gets or sets the number of columns displayed in the DataGridView.
DataGridView.RowCount = Gets or sets the number of rows displayed in the DataGridView.
DataGridView.Item(Int32,Int32).Value = Provides an indexer to get or set the cell located at the intersection of the column and row with the specified indexes, and then returns the value.
Add More Here
For Row and Col properties you could use something like:
Public Class MyGrid
Inherits System.Windows.Forms.DataGridView
(...)
Public Property Col() As Integer
Get
Return Me.CurrentCell.ColumnIndex
End Get
Set(ByVal value As Integer)
Me.CurrentCell = Me(value, Me.CurrentCell.RowIndex)
End If
End Set
End Property
(...)
Public Property Row() As Integer
Get
Return Me.CurrentCell.RowIndex
End Get
Set(ByVal value As Integer)
Me.CurrentCell = Me(value, Me.CurrentCell.ColumnIndex)
End If
End Set
End Property
(...)
End Class
Then keep looking and matching every property, method and events with the original control.