2

Any ideas on how to Use Forms created in VB 6.0 in VB.NET ?

TAbdiukov
  • 1,185
  • 3
  • 12
  • 25
Asad
  • 517
  • 4
  • 10
  • 13

2 Answers2

5
  1. Put your VB 6 in a DLL. Create a public method that invokes a modal dialog from VB 6.
  2. From your .NET program, reference the DLL built in VB 6 (COM tab)
  3. Invoke the method. Your VB6 modal form will appear.

If you want to show a modeless form, you may be out of luck because VB 6 requires that the caller of the dialog do special processing in the message pump. However, you may be able to trick the system by trying this: From the VB 6 code, rather than calling the Show method of the VB 6 form, set the .Visible property of the VB 6 modeless form to True. It will probably work. Some things may not work such as button shortcuts, and some ActiveX controls embedded in the VB 6 code might have problems.

zumalifeguard
  • 8,648
  • 5
  • 43
  • 56
1

Try this post:

Can/how do you host a full VB6 Form in a C# WPF app?

Having done this myself several times in the past, let me just say this is not fun stuff.

Community
  • 1
  • 1
Jeff
  • 35,755
  • 15
  • 108
  • 220