EXPERT RESPONSE
1) If you created your application with the proper separation of layers (i.e. a library for the business logic, another for UI stuff, another (optional?) for DB access), you can reuse as-is all except for the UI one. You will need to recreate all screens, unfortunately. There's no tool that I'm aware of.
2) Now the problem is clearer. It seems that what you're doing is upgrading from VB6. If you have a well defined naming convention for your controls, you could use a global search and replace to append the .Text property access in the second case. The first case can also be solved with a global search and replace using regular expressions. You actually have to not only create a new variable for the form, but you also have to call Show on it. Here's how to configure the Search & Replace dialog:
Find what: Load({[^)]*})
Replace with: Dim temp As New 1ntttemp.Show()
Use: Regular Expressions
If you have the following in the original source:
Load(frmTemp)
After the replace you'll have:
Dim temp As New frmTemp
temp.Show()
Key points: the curly braces inside the expression ({[^)]*}) captures the value so you can refer to it from the replacement string using 1 (or 2, 3, etc for subsequent capture groups). The expression in this case captures any string that is not the closing parenthesis, after the initial opening parenthesis, which must be escaped using ). The n is used to output a new line, and t for a Tab.
|