views:

119

answers:

2

Hi,

I am supposed to be updating a piece of software for someone. Originally written in VB 6 I want to import it into a .net c# project. My question is, I don't want to have to lay out all the forms again and I am wondering if, or how, I could import them into c# project. They originally come with the .frm extension and c# forms are .cs. I tried 'add existing item' to the project but obviously that didn't work, and I tried a couple of other things. Is there a way of importing them that would work? I just need the layout, not worried about the underlying code or anything as this will all be re-written.

Thanks, R.

+3  A: 

You can utilize the VB upgrade wizard, but that will only get you to VB.NET (potentially as there as some things that cannot be upgraded). Or you can compile your VB6 app to a COM dll... then call the COM dll via interop.

Kris Krause
The best option is probably to migrate to VB.NET using the upgrade wizard, build the forms into a VB.NET library, and reference that library from C#...
Thomas Levesque
I'll give you the nod for the suggestion of upgrading. In the end I have simply decided to rebuild the project forms from scratch as there is a swathe of new tools plus the client wanted a whole new load of functionality, plus there was the dead code, really bad design etc. etc. Thanks for the answers, now I know :)
flavour404
+2  A: 

As already mentioned, you can migrate to VB.NET first. You can copy and paste controls from one project's form to another's.

JTA