Written by: Friday, August 13, 2010
In our company we do not program in VB.NET. Not that we have anything against it, we have just specialized in C# when we program .NET applications.
We are are aware that our WinForms libraries (DigitalRune Docking Windows and the DigitalRune Text Editor Control) are used by many VB programmers. And they regularly ask for VB example code.
Here are a few ways to automatically convert C# code to VB (or the other way around):
Here is an online tool that converts code snippets from one language to another:
http://www.developerfusion.com/tools/convert/csharp-to-vb/
It does not convert full projects.
There is commercial software that translates C# to VB.NET. For example:
http://www.tangiblesoftwaresolutions.com/Product_Details/Instant_VB.html.
We haven't tried it because we prefer method number 3:
If you don't know Reflector, go and get it right know (http://www.red-gate.com/products/reflector/). This is an important tool for every .NET programmer.
To see VB code load an assembly (e.g. SampleEditor.exe of the DigitalRune Text Editor Control). Right-click in the left tree view and select "Disassemble" to see the right code window. If you don't see VB code then choose "Visual Basic" in the tool bar.
You can also right-click in the left tree view to "Export…". This creates a solution with the VB code. The auto-converted code is not perfect but it is often a good start to create a final VB sample. In many cases it provides enough information so that a VB programmer with little C# experience can understand C# sample code.
0 comment(s) so far...
A collection of the most useful blog articles can be found here:
Article Collection (on Documentation page)
DigitalRune is a trademark of Garstenauer Information Technology OG.
Garstenauer Information Technology OG Weingartenstrasse 35, 4452 Ternberg Austria (EUROPE) office@digitalrune.com