These are the options for the grid controls supported by the VBUC out of the box. This list includes the most common controls used by VB6 applications.
It is worth remembering that the VBUC is a fully customizable tool, therefore if an application uses a grid control not present in this list, it is possible for Mobilize to create customization to migrate it automatically to a .NET component.
1. FPSpread
1.1. To FarPoint Spread helper class
Conversion of FarPoint Spread for Windows Forms using a helper class.
The VBUC supports FPSpread version 3.0.37
General Description:
The FarPoint Spread for Windows Forms is a comprehensive spreadsheet component for Windows applications that combines grid capabilities, spreadsheet functionality, and includes the ability to bind to data sources or programmatically inserted data.
Deployment Note:
The VBUC converts the FPSpread ActiveX to a helper class.
Original VB6 code:
Begin FPSpread.vaSpread vaSpread1... SpreadDesigner ="Form1.frx":0000End
Public WithEvents vaSpread1 As UpgradeHelpers.Spread.FpSpreadPrivate Sub InitializeComponent()... Me.vaSpread1 =NewUpgradeHelpers.Spread.FpSpread Me.vaSpread1.Name ="vaSpread1"... Me.Controls.Add(Me.vaSpread1)
1.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
Begin FPSpread.vaSpread vaSpread1... SpreadDesigner ="Form1.frx":0000End
Public WithEvents vaSpread1 As AxFPSpread.AxvaSpreadPrivate Sub InitializeComponent() Me.vaSpread1 =NewAxFPSpread.AxvaSpread Me.vaSpread1.Name ="vaSpread1" Me.vaSpread1.OcxState =CType(resources.GetObject("vaSpread1.OcxState"), System.Windows.Forms.AxHost.State)... Me.Controls.Add(Me.vaSpread1)
2. MSDataGridLib
2.1. To System.Windows.Forms.DataGridView
Map Microsoft's MSDataGridLib to DataGridView from Windows.Forms.
Original VB6 code:
Private Sub Form_Load() Dim ctl As DataGrid Set ctl = DataGrid1MsgBox(ctl.Columns(1).Text)End Sub
Private Sub Form_Load() Dim ctl As DataGridView = DataGrid1 MessageBox.Show(ctl.CurrentRow.Cells(ctl.Columns(1).Name).Value.ToString(), My.Application.Info.Title)End Sub
2.2. To ComponentOne True DBGrid
Map Microsoft's MSDataGridLib to Component1's C1.Win.C1TrueDBGrid.
Original VB6 code:
Private Sub Form_Load() Dim ctl As DataGrid Set ctl = DataGrid1MsgBox(ctl.Columns(1).Text)End Sub
Private Sub Form_Load() Dim ctl As C1.Win.C1TrueDBGrid.C1TrueDBGrid = DataGrid1 MessageBox.Show(ctl.Columns(1).Text, My.Application.Info.Title)End Sub
2.3. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
Private Sub Form_Load() Dim ctl As DataGrid Set ctl = DataGrid1MsgBox(ctl.Columns(1).Text)End Sub
Private Sub Form1_Load(ByVal eventSender As Object, ByVal eventArgs As EventArgs) Handles MyBase.Load Dim ctl As AxMSDataGridLib.AxDataGrid = DataGrid1 MessageBox.Show(ctl.Columns(1).Text, My.Application.Info.Title)End Sub
3. MSDBGridLib
3.1. To System.Windows.Forms.DataGridView + Helper classes
Map MSDBGridLib to DataGridView using the DataGridViewTrueDB class. Some properties use the UpgradeHelpers.DataGridViewTrueDB helper class.
Original VB6 code:
Private Sub Form_Load()... Me.DBGrid1.Caption ="Hello" text = Me.DBGrid1.Caption Me.DBGrid1.Height =1800 Me.DBGrid1.Enabled =FalseEnd Sub
C# code:
privatevoidForm_Load(){this.DBGrid1.Text="Hello";string text =this.DBGrid1.Text;this.DBGrid1.Height=120;this.DBGrid1.Enabled=false;}
VB.NET code:
Private Sub Form_Load() Me.DBGrid1.Text ="Hello" Dim text_Renamed AsString= Me.DBGrid1.Text Me.DBGrid1.Height =120 Me.DBGrid1.Enabled =FalseEnd Sub
3.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
Private Sub Form_Load()... Me.DBGrid1.Caption ="Hello" text = Me.DBGrid1.Caption Me.DBGrid1.Height =1800 Me.DBGrid1.Enabled =FalseEnd Sub
C# code:
privatevoidForm_Load(){this.DBGrid1.Caption="Hello";string text =this.DBGrid1.Text;this.DBGrid1.Height=120;this.DBGrid1.Enabled=false;}
VB.NET code:
Private Sub Form_Load() Me.DBGrid1.Caption ="Hello" Dim text_Renamed AsString= Me.DBGrid1.Text Me.DBGrid1.Height =120 Me.DBGrid1.Enabled =FalseEnd Sub
4. MSFlexGrid
4.1. To DataGridViewFlex helper class
Map Microsoft's MSFlexGridLib to a helper class that extends the System.Windows.Forms.DataGridView component.
Original VB6 code:
Private Sub Form_Load() Dim ctl As MSFlexGrid Set ctl = MSFlexGrid1 ctl.ScrollBars = flexScrollBarBoth ctl.GridLines = flexGridNoneEnd Sub
Private Sub Form_Load(ByVal eventSender AsObject, ByVal eventArgs As EventArgs) Handles MyBase.Load Dim ctl As UpgradeHelpers.DataGridViewFlex = MSFlexGrid1 ctl.ScrollBars = ScrollBars.Both ctl.CellBorderStyle = DataGridViewCellBorderStyle.NoneEnd Sub
4.2. To ComponentOne FlexGrid
Map Microsoft's MSFlexGridLib to Component1's C1.Win.C1FlexGrid.
Original VB6 code:
Private Sub Form_Load() Dim ctl As MSFlexGrid Set ctl = MSFlexGrid1 ctl.ScrollBars = flexScrollBarBoth ctl.GridLines = flexGridNoneEnd Sub
Private Sub Form1_Load(ByVal eventSender AsObject, ByVal eventArgs As EventArgs) Handles MyBase.Load Dim ctl As C1.Win.C1FlexGrid.C1FlexGrid = MSFlexGrid1 ctl.ScrollBars = ScrollBars.Both ctl.Styles.Normal.Border.Style = C1.Win.C1FlexGrid.BorderStyleEnum.NoneEnd Sub
4.3. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
Private Sub Form_Load() Dim ctl As MSFlexGrid Set ctl = MSFlexGrid1 ctl.ScrollBars = flexScrollBarBoth ctl.GridLines = flexGridNoneEnd Sub
Private Sub Form1_Load(ByVal eventSender AsObject, ByVal eventArgs As EventArgs) Handles MyBase.Load Dim ctl As AxMSFlexGridLib.AxMSFlexGrid = MSFlexGrid1 ctl.ScrollBars = MSFlexGridLib.ScrollBarsSettings.flexScrollBarBoth ctl.GridLines = MSFlexGridLib.GridLineSettings.flexGridNoneEnd Sub
5. TrueDBGrid
5.1. To .NET component that extends the DataGridView
Convert TrueDBGrid to a .NET helper component that extends the System.Windows.Forms.DataGridView control.
The VBUC currently supports the automatic conversion for version 5.0, 6.0, and 7.0 of this control.
By using this option the converted application will not have any reference to the COM Component and no additional licenses are required.
Similar classes within TrueOLEDBGrid60, TrueDBGrid70, and TrueOLEDBGrid70 are mapped to the associated class in this table.
Original VB6 code:
Begin VB.Form Form1 ...Begin TrueOleDBGrid70.TDBGrid TDBGrid1 Height =2775 Width =4935 Left =1920 TabIndex =0 Top =840...
Partial ClassForm1 ... Public WithEvents TDBGrid1 As C1.Win.C1TrueDBGrid.C1TrueDBGrid ... Private Sub InitializeComponent() ... Me.TDBGrid1 = New C1.Win.C1TrueDBGrid.C1TrueDBGrid Me.TDBGrid1.Location = New System.Drawing.Point(128, 56) Me.TDBGrid1.Name = "TDBGrid1" Me.TDBGrid1.Size = New System.Drawing.Size(329, 185) Me.TDBGrid1.TabIndex = 0 ...
5.3. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
Begin VB.Form Form1 ...Begin TrueOleDBGrid70.TDBGrid TDBGrid1 Height =2775 Width =4935 Left =1920 TabIndex =0 Top =840...
Partial ClassForm1 ... Public WithEvents TDBGrid1 As AxTrueOleDBGrid70.AxTDBGrid ... Private Sub InitializeComponent() ... Me.TDBGrid1 = New AxTrueOleDBGrid70.AxTDBGrid Me.TDBGrid1.Location = New System.Drawing.Point(128, 56) Me.TDBGrid1.Name = "TDBGrid1" Me.TDBGrid1.OcxState = CType(resources.GetObject("TDBGrid1.OcxState"), System.Windows.Forms.AxHost.State) Me.TDBGrid1.Size = New System.Drawing.Size(329, 185) Me.TDBGrid1.TabIndex = 0 ...
6. VSFlexGrid
6.1. To ComponentOne FlexGrid
Map VideoSoft’s VSFlex classes and enums to Component1’s C1FlexGrid equivalents.
The following controls are supported:
VSFlexLib
VSFlex6
VSFlex6Ctl
VSFlex6d
VSFlex6DAOCtl
VSFlex7
VSFlex7Ctl
VSFlex7d
VSFlex7DAOCtl
VSFlex7L
VSFlex7LCtl
VSFlex8
VSFlex8Ctl
VSFlex8d
VSFlex8DAOCtl
VSFlex8L
VSFlex8LCtl
VSFlex8n
VSFlex8NCtl
Original VB6 code:
Dim fg As vsFlexGridSet fg = vsFlexGrid1fg.ColAlignment(0)= flexAlignCenterCenterfg.ColAlignment(1)= flexAlignRightCenterfg.ColAlignment(2)= flexAlignLeftCenter
Dim fg As C1.Win.C1FlexGrid.C1FlexGrid = vsFlexGrid1fg.Cols(0).TextAlign = C1.Win.C1FlexGrid.TextAlignEnum.CenterCenterfg.Cols(1).TextAlign = C1.Win.C1FlexGrid.TextAlignEnum.RightCenterfg.Cols(2).TextAlign = C1.Win.C1FlexGrid.TextAlignEnum.LeftCenter
6.2. To COM Interop
This feature will take the legacy COM control and create an interoperability code wrapper to make it visible from the managed code. This means the control's functionality will remain the same since it will use the same binary, but the resulting application will depend on the legacy control.
Original VB6 code:
Dim fg As vsFlexGridSet fg = vsFlexGrid1fg.ColAlignment(0)= flexAlignCenterCenterfg.ColAlignment(1)= flexAlignRightCenterfg.ColAlignment(2)= flexAlignLeftCenter
Dim fg As AxVSFlex6.AxvsFlexGrid = vsFlexGrid1fg.ColAlignment(0)= VSFlex6.AlignmentSettings.flexAlignCenterCenterfg.ColAlignment(1)= VSFlex6.AlignmentSettings.flexAlignRightCenterfg.ColAlignment(2)= VSFlex6.AlignmentSettings.flexAlignLeftCenter