I have a large number of VB6 apps that I would like to convert to VB.net. All of them use a standard (here anyway) technique of calling a public sub and passing the form reference byref so many frequently used subs/functions can be used without regard to the calling form's name. private sub Form_Load() call registerForm(Form1) end sub In a common module... public myForm as form public sub registerForm(byRef theForm as Form) set myForm = theForm end sub public sub otherSubs() myForm.caption = "some title" & app.version... myForm.lstRoles.clear end sub I've run a couple of these programs through VB.net 2008 and it warns me of an error that my controls cannot be referenced because they are in the generic namespace Form. I'd like to know how a similar technique is written in .Net? Any direction greatly appreciated. Steve
"Steve Ricketts" wrote in message news:uNZGN8BmIHA.3940@TK2MSFTNGP05.phx.gbl... >I have a large number of VB6 apps that I would like to convert to VB.net. >All of them use a standard (here anyway) technique of calling a public sub >and passing the form reference byref so many frequently used subs/functions >can be used without regard to the calling form's name. > > private sub Form_Load() > call registerForm(Form1) > end sub > > In a common module... > > public myForm as form > > public sub registerForm(byRef theForm as Form) > set myForm = theForm > end sub > > public sub otherSubs() > myForm.caption = "some title" & app.version... > myForm.lstRoles.clear > end sub > > I've run a couple of these programs through VB.net 2008 and it warns me of > an error that my controls cannot be referenced because they are in the > generic namespace Form. > > I'd like to know how a similar technique is written in .Net? Any > direction greatly appreciated. > > Steve >
"Steve Ricketts" 's wild thoughts were released on Sun, 6 Apr 2008 16:16:24 -0400 bearing the following fruit: >I have a large number of VB6 apps that I would like to convert to VB.net. >All of them use a standard (here anyway) technique of calling a public sub >and passing the form reference byref so many frequently used subs/functions >can be used without regard to the calling form's name. > You need to post the real code that is causing the error. You also need to post the exact error message. -- Jan Hyde https://mvp.support.microsoft.com/profile/Jan.Hyde