BUG: The DrawCell event of the vsFlexArray and vsFlexGrid controls in Visual Basic 6.0 is not upgraded to Visual Basic .NET or to Visual Basic 2005 (814316)
The information in this article applies to:
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
SYMPTOMSA project that was created by using Microsoft Visual Basic 6.0 and the Standard EXE project template contains either the vsFlexArray ActiveX control or the vsFlexGrid
ActiveX control, and the DrawCell event of the control is defined. After you upgrade the
project to Visual Basic .NET 2003, you observe that the DrawCell event is upgraded as follows:
'UPGRADE_NOTE: Left was upgraded to Left_Renamed. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup1061"'
Private Sub vsFlexArray1_DrawCell(ByVal hDC As Integer, ByVal Row As Integer, ByVal Col As Integer, ByVal Left_Renamed As Integer, ByVal Top_Renamed As Integer, ByVal Right_Renamed As Integer, ByVal Bottom_Renamed As Integer, ByRef Done As Boolean)
Text1.Text = CStr(Row)
End Sub However, the code that you expect is the following: Private Sub vsFlexArray1_DrawCell(ByVal eventSender As System.Object, ByVal eventArgs As AxvsFlexLib._DvsFlexArrayEvents_DrawCellEvent) Handles vsFlexArray1.DrawCell
Text1.Text = CStr(eventArgs.Row)
End Sub CAUSEThe
problem occurs because the tool that is used to upgrade has
to rename the event parameters in Visual Basic 6.0 because new keywords are
used in Visual Basic .NET or in Visual Basic 2005. The upgrade tool does not successfully build the new
event signature with an Eventargs parameter in Visual Basic .NET or in Visual Basic 2005. Therefore, this problem occurs in
any ActiveX control where the upgrade tool determines that the event parameters must be renamed.WORKAROUNDTo work around this problem, add the DrawCell event to the upgraded code. To add the code, follow these steps:
- In
the code editor tool,
select the DrawCell event for vsFlexArray1 from the
Declarations list.
- Add the following code to the DrawCell
event of vsFlexArray1:
Text1.Text = e.row
STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are
listed at the beginning of this article.
REFERENCESFor more information, visit the following MSDN web site:
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kbMigration kbUpgrade kbEvent kbWindowsForms kbCtrl kbControl kbActivexEvents kbbug KB814316 kbAudDeveloper |
---|
|