0

I have a large VB6 app which I want to convert to C#.

The majority of the code in VB6 is quite badly written.

I thought that a good strategy would be to keep the GUI design since it is adequate and would be a pain to recreate. But I would want to rewrite the code behind the GUI and the data layer.

I could keep the GUI design by using one of the VB6 to .NET converters provided by Microsoft.

Would this be a good strategy?

CJ7
  • 22,579
  • 65
  • 193
  • 321
  • 2
    To be honest with you I would recreate the Gui. I have never been happy with the maintainability/Readibility of Vb6 to .Net Converter output. I have always just recreated my VB6 apps it is a lot cleaner that way even if it is more work. – Mark Hall Nov 19 '11 at 07:58
  • @MarkHall: I would have thought the GUI conversion would be pretty clean. I certainly don't want to have to design all those forms again! – CJ7 Nov 19 '11 at 11:06
  • Gui only might be. there will be airspace issues if your controls are close together because of the lack of true transparency in Winforms. – Mark Hall Nov 19 '11 at 21:46
  • @MarkHall: what do you mean by their being a "lack of true transparency" in Winforms? – CJ7 Nov 25 '11 at 07:06
  • for instance if you set the label background to transparent it will become the color of the form background. If you have another label overlapping the text of the label that is behind the other one will be covered up. This caused me issues when I converted my forms because I had labels that were close together in VB6 that I couldn't place where I wanted. It limited how much I could put on a form. I hope I made my self clear it looks like double speak. – Mark Hall Nov 25 '11 at 07:11
  • Take a look at this [CodeProject Article](http://www.codeproject.com/KB/dotnet/transparent_controls_net.aspx) for further information. – Mark Hall Nov 25 '11 at 07:20
  • @CJ7 "I could keep the GUI design by using one of the VB6 to .NET converters provided by Microsoft." May I know which tool can be used for this? I have to convert vb 6 UI to .net. If I get to know such tool, that would be great help. – Sanjivani Nov 29 '13 at 10:07

2 Answers2

4

There are several migration tool to perform a migration from VB6 to a .NET language, one of the best today is VBUC , however if your rewriting your underlying code maybe it is better to rewrite also the GUI layer, because the migration tools usually don't do a perfect job with gui migration and the generated gui often looks ugly and "old-style".

aleroot
  • 71,077
  • 30
  • 176
  • 213
0

Please refer to my post in your related thread stackoverflow

I would not. You have a great chance to build something good from the start. Don't simply import the old UI.

Community
  • 1
  • 1
UnhandledExcepSean
  • 12,504
  • 2
  • 35
  • 51