Click here to Skip to main content
15,888,286 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a problem as follow:
I have a project in VB6 and now i convert it to VB.NET.IN this project has used control fpspread but in VB.NET I used datagridview so I do not how to convert it.
I want to change codeform fpspread in VB6 to datagridview in VB.NET so you can get me a table that compare their properties?

could you help me, please?
thanks!

my code:
Private Sub Form_Load()
   Dim lSprIdx    As Long
   Dim nCnt As Integer
   Dim nFileNum As Integer
   Dim nMsgNo As Integer
   Dim aLine As String
   Dim aMsgInf As String
   Dim aSplit() As String
   Dim aRead() As String

   Me.Caption = m_CapName + " my form"
   nCnt = 0
   nFileNum = FreeFile
   Open DSP_FILE For Input As #nFileNum                     
   Do Until EOF(nFileNum)                                   
      ReDim Preserve aRead(nCnt)                            
      Line Input #nFileNum, aLine                           
      aRead(nCnt) = aLine                                   
      nCnt = nCnt + 1                                       
   Loop
   Close nFileNum                                          

   spdTbl.Row = m_DspIdx                                    
   spdTbl.Col = 1
   spdTbl.Action = 0
   spdTbl.SelModeSelected = True
   With spdTbl
       .ReDraw = False                                                                     
       For lSprIdx = 1 To nCnt - 1                          
           Call SplitCSVData(aRead(lSprIdx), aSplit)
           nMsgNo = Trim(Str(aSplit(0)))
           aMsgInf = aSplit(1)
           .Row = lSprIdx
           .Col = 1
           .Text = nMsgNo                                   
           .Col = 2
           .Text = aMsgInf                                  
       Next lSprIdx
       .Row = 0: .Row2 = 0                                                                 
       .Col = 0: .Col2 = .MaxCols
       .ForeColor = &H0&
       .BlockMode = True
       .Font.Bold = True
       .BlockMode = False
       .Row = 1
       .Col = 1
       If spdTbl.ActiveRow = 1 Then
           .SelModeSelected = True
       End If
       .ReDraw = True                                                                      
   End With
   spdTbl.MaxRows = lSprIdx - 1
   Erase aSplit                                             
   Erase aRead                                              
End Sub
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900