BYTEINSIGHT
GAPVelocity AI Studio helps you move from outdated tech stacks to the latest desktop, web, and cloud platforms—smarter, faster, and with less risk.
Choose a platform to see migration options:
Our comprehensive approach to application modernization, from assessment to production deployment.
Transformation Services
Not Sure Where to Start?
The VBUC is able to map VB6 library members to .NET equivalents. These equivalents are chosen to provide maximum functional equivalence on the target platform. In particular scenarios, some class properties and events may not have a direct equivalent in .NET or may have not been mapped in the current release of the VBUC. The event handler is declared in the target source code but there are no equivalent events to associate the handler to.
Sample taken from Drag & Drop Changes in Visual Basic .Net:
Private Sub Text1_OLEDragOver(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single, State As Integer) 'Make sure that the format is text. If Data.GetFormat(vbCFText) Then 'If it is text, enable dropping for the second Textbox. Text1.OLEDropMode = vbOLEDropManual End If End Sub
'UPGRADE_WARNING: (2050) TextBox Event Text1.OLEDragOver was not upgraded. Private Sub Text1_OLEDragOver(ByVal Data As DataObject, ByVal Effect As Integer, ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single, ByVal State As Integer) 'Make sure that the format is text. 'UPGRADE_ISSUE: (2064) ClipBoardConstants property ClipBoardConstants.vbCFText was not upgraded. If Data.GetFormat(UpgradeSolution1Support.UpgradeStubs.VBRUN_ClipBoardConstants.getvbCFText()) Then 'If it is text, enable dropping for the second Textbox. 'UPGRADE_ISSUE: (2070) Constant vbOLEDropManual was not upgraded. 'UPGRADE_ISSUE: (2064) TextBox property Text1.OLEDropMode was not upgraded. Text1.setOLEDropMode(UpgradeSolution1Support.UpgradeStubs.VBRUN_OLEDropConstants.getvbOLEDropManual()) End If End Sub
In this case the sample code deals with manually handling Drag & Drop operations in a Visual Basic 6 application. As stated previously the sample code is from Drag & Drop Changes in Visual Basic .Net.
As is clearly stated in that MSDN article we need to write custom code for the drag & drop operation. In this case we replace the OLEDragOver event which no longer exists in .Net and replace it with the DragEnter event. Within this event we add our drag & drop logic.
Private Sub Text1_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles Text1.DragEnter 'Make sure that the format is text. If (e.Data.GetDataPresent(DataFormats.Text)) Then 'Allow Drop e.Effect = DragDropEffects.Copy Else ' Do not allow drop e.Effect = DragDropEffects.None End If End Sub
//UPGRADE_WARNING: (2050) TextBox Event Text1.OLEDragOver was not upgraded. private void Text1_OLEDragOver(DataObject Data, int Effect, int Button, int Shift, float X, float Y, int State) { //Make sure that the format is text. //UPGRADE_ISSUE: (2064) ClipBoardConstants property ClipBoardConstants.vbCFText was not upgraded. if (Data.GetFormat((short) UpgradeStubs.VBRUN_ClipBoardConstants.getvbCFText())) { //If it is text, enable dropping for the second Textbox. //UPGRADE_ISSUE: (2070) Constant vbOLEDropManual was not upgraded. //UPGRADE_ISSUE: (2064) TextBox property Text1.OLEDropMode was not upgraded. Text1.setOLEDropMode(UpgradeStubs.VBRUN_OLEDropConstants.getvbOLEDropManual()); } }
In this case the sample code deals with manually handling Drag & Drop operations in a Visual Basic 6 application. As stated previously the sample code is from Drag & Drop Changes in Visual Basic .Net.
As is clearly stated in that MSDN article we need to write custom code for the drag & drop operation. In this case we replace the OLEDragOver event which no longer exists in .Net and replace it with the DragEnter event. Within this event we add our drag & drop logic.
private void Text1_DragEnter(object sender, DragEventArgs e) { //Make sure that the format is text. if (e.Data.GetDataPresent(DataFormats.Text)) { //Allow drop e.Effect = DragDropEffects.Copy; } else { e.Effect = DragDropEffects.None; } }