Using VB 6.0 Forms in VB.NET
Any ideas on how to Use F开发者_如何学JAVAorms created in VB 6.0 in VB.NET ?
- Put your VB 6 in a DLL. Create a public method that invokes a modal dialog from VB 6.
- From your .NET program, reference the DLL built in VB 6 (COM tab)
- 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.
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.
精彩评论