The simple Vb code :
Imports System
Imports System.Windows.Forms
Imports System.Runtime.InteropServices
Imports AxMSFlexGridLib
Public Class Form1
Inherits Form
Private versionLabel As New Label()
Private textBox1 As New TextBox()
Public Sub New()
Me.Text = "FlexGrid Example"
Me.Size = New Size(500, 400)
AxMSFlexGrid1 = New AxMSFlexGrid()
AxMSFlexGrid1.Size = New Size(300, 200)
AxMSFlexGrid1.Location = New Point(50, 150)
Me.Controls.Add(AxMSFlexGrid1)
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
AxMSFlexGrid1.Rows = 3
AxMSFlexGrid1.Cols = 3
' Populate the MSFlexGrid with data
AxMSFlexGrid1.set_TextMatrix(0, 0, "Name")
AxMSFlexGrid1.set_TextMatrix(0, 1, "usn")
AxMSFlexGrid1.set_TextMatrix(0, 2, "college")
AxMSFlexGrid1.set_TextMatrix(1, 0, "John")
AxMSFlexGrid1.set_TextMatrix(1, 1, "123")
AxMSFlexGrid1.set_TextMatrix(1, 2, "XYZ")
AxMSFlexGrid1.set_TextMatrix(2, 0, "Adam")
AxMSFlexGrid1.set_TextMatrix(2, 1, "456")
AxMSFlexGrid1.set_TextMatrix(2, 2, "PQR")
End Sub
Private Sub AxMSFlexGrid1_Enter(sender As Object, e As EventArgs) Handles AxMSFlexGrid1.Enter
End Sub
End Class