all groups > vb.net upgrade > november 2004 >
You're in the

vb.net upgrade

group:

vb6 upgrade to VB.NET Use of ActiveForm


vb6 upgrade to VB.NET Use of ActiveForm jim.ebner NO[at]SPAM baesystems.com
11/10/2004 8:42:50 AM
vb.net upgrade:
I am having problems converting a VB6 application to VB .NET,
particularly the following code causes problems:
Visual Basic Code (VB6 SP4):

Private Sub mnuCOPpppECDC_Csub_Click(Index As Integer)
Select Case Index
Case 0 'New element
Call Screen.ActiveForm.mnuECDC_NewElt_Click
Case 1 'New issue
Call Screen.ActiveForm.mnuECDC_NewIss_Click
Case 2 'New Draft version
Call Screen.ActiveForm.mnuECDC_NewDraft_Click
End Select

End Sub

The conversion on all cases gives the following 'UPGRADE_ISSUE:
Control mnuECDC_NewElt_Click could not be resolved because it was
within the generic namespace ActiveMDIChild. The command is converted
to:
"Call System.Windows.Forms.Form.ActiveForm.mnuECDC_NewElt_Click()"

Re: vb6 upgrade to VB.NET Use of ActiveForm Herfried K. Wagner [MVP]
11/13/2004 12:20:49 AM
"Jim Ebner" <jim.ebner@baesystems.com> schrieb:
[quoted text, click to view]

For MDI children:

\\\
DirectCast(Me.ActiveMdiChild, FooForm).Bla = ...
///

For normal forms:

\\\
DirectCast(Form.ActiveForm, FooForm).Bla = ...
///

.... where 'FooForm' is the type of your form.

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>

AddThis Social Bookmark Button