Thursday, 15 April 2010

winforms - How to implement a Windows Form in vb2008 in vb6 -



winforms - How to implement a Windows Form in vb2008 in vb6 -

i have written test-form in vb2008 in order phone call mdi-child in vb6:

the code followed: `

imports system.runtime.interopservices <comclass(frmtest.classid, frmtest.interfaceid, frmtest.eventsid)> _ public class frmtest inherits system.windows.forms.form #region "com-guids" public const classid string = "" public const interfaceid string = "" public const eventsid string = "" #end part public sub new() mybase.new() initializecomponent() end sub public overloads sub show(byval mdi object) me.mdiparent = ctype(mdi, system.windows.forms.form) me.show end sub public sub sometext(byval text string) msgbox(text) end sub private sub button1_click(byval sender system.object, byval e system.eventargs) handles button1.click msgbox("test") end sub end class

`

in vb6, under references create reference tlb.

so far, good.

i open new project , create new mdi-form.

private sub start_click(index integer) dim f new mytestlibrary.frmtest f.show (me) end sub

unfortunately, approach not work, because com-component, , error occurs. knows verified way create windows .net form available in vb6 ???

thank you, in advance.

stephan

put vb 6 in dll. create public method invokes modal dialog vb 6. from .net program, reference dll built in vb 6 (com tab) invoke method. vb6 modal form appear.

however, things may not work such activex controls embedded in vb 6 code might have problems.

winforms vb6

No comments:

Post a Comment