VB6 / VBA MSFlexGrid for VB.NET DataGridView

And again more fantastic VB6 in VB.NET .

Well, this is not necessarily a “question” in the definition, but it will answer many questions that users will have in the future, and hopefully also answer my questions.

I am trying to compile a list of properties and functions in MSFlexGrid in VB6 / VBA and .NET DataGridView , which provide the same or somewhat the same use. I not only need them, but I am sure that there are others who do.

So far this is what I have, and I would like others to be free to add and edit as you please. I hope this helps me and others convert the old controls into .NET controls with the same functionality as in their old code. If you would like to add, please enter the relation in BlockQuote and the definition in its own 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 

VB6 Definitions :

  • MSFlexGrid. Cols = Gets or sets the total number of columns in the MSFlexGrid .

  • MSFlexGrid. Col = Gets or sets the coordinates of the active cell in MSFlexGrid .

  • MSFlexGrid. Rows = Gets or sets the total number of rows in MSFlexGrid .

  • MSFlexGrid. String = returns or sets the coordinates of the active cell in MSFlexGrid .

  • MSFlexGrid. TextMatrix = Gets 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 String and Col properties.

  • MSFlexGrid. TextArray = Gets 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 String and Col properties .

  • Add more here


VB.NET Definitions:

  • 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. Element (Int32, Int32) .Value = Provides an index for getting or setting a cell located at the intersection of a column and a row with the specified indices, and then returns a value.

  • Add more here

+7
source share
1 answer

For the Row and Col properties, you can 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 continue to search and map each property, method, and event to the original control.

+1
source

All Articles