Click here to Skip to main content
13,446,015 members (38,993 online)
Click here to Skip to main content
Add your own
alternative version


10 bookmarked
Posted 9 Sep 2007

Convertion of Xdock VB to CS by C-Sharpener For VB.

, 18 Sep 2007
Rate this:
Please Sign up or sign in to vote.
Convertion VB to CS by C-Sharpener For VB of the XDock projet


This article speak about to translation of vb in c#

I have seen the good idea xDock.asp, and I want to have the same thing in C#
because originally the code is in VB dotnet.


So I thinking in my self, it wil be no difficult to translate it , or to find a automatic translater.
I use but there's a lot of thing it not translate and make error.

Public Sub Add(ByVal Item As IDockItem, Optional ByVal Key As String = Nothing, Optional ByVal Before As IDockItem = Nothing, Optional ByVal After As IDockItem = Nothing)

Is convert by :

public void Add(IDockItem Item, // ERROR: Unsupported modifier : In, Optional string Key, // ERROR: Unsupported modifier : In, Optional IDockItem Before, // ERROR: Unsupported modifier : In, Optional IDockItem After)


Is Convert by

Information.IsNumeric(Value)) -> But in CSharp there'snt IsNumeric..

Using C-Sharpener For VB

I have seen a translater vb to c# on the web site : : C-Sharpener For VB

And they provide free translation for openSource project, so I ask to them if it's possible to translate XDock from VB to C#
So they give me a licence to do that.

I'll describe how the translator works and what kind of problem I have.

I integration in MSVC is good.
You must load your vb project and apply the translator C-Shaperer for VB.

Screenshot - img5.jpg

Screenshot - img4.jpg

Screenshot - img3.jpg

Screenshot - img2.jpg

Screenshot - img1.jpg

Screenshot - img6.jpg
After you have a report.

It's not magick, there're errors but it's not so hard to resolve.
The converter is really well embdded in msvc Express , and He create a project
in this case XDock_CS and convert le res file and the dependency.

For example , in file the IsNumeric if translated well , I never had problem with that.

The main difficulty is about the XDock file iniFile.vb , because in this code
the author don't strenght type of the objet in the ArryaList.
It could be a Key or a ArrayList.

But C# is less permicive than VB.
( I have some difficulty to understand )

So object is always object in c#, but in c# you have to cast this object in the good one you want to.

There's no information to know that then , the translater can find it.

( I guest in in VB the type could find at runtime )

I put in comment this line because I don't understand how to translate :

//pSkinMenu = this.mnuSkins.MenuItems.Add( pDirectory.Name, new /* TRANSERROR: replace with correct delegate */ UnknownDelegate( ContextHandler ) );

So I delete some functionnality to have only the control moving with icon.
I share my work.

I was impressed by the product C-Sharpener For VB because I don't know anything about VB and I successfull in this task.
And the web converted is good for a simple translation, but this product translate all the project easily.

Thank's to

<a href=""><img src="convertedby.gif" alt="Converted from VB.NET to C# by C-Sharpener For VB"></a>
Roger Jack of


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Software Developer (Senior)
France France
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 5 Pin
manoj kumar choubey26-Feb-12 21:13
membermanoj kumar choubey26-Feb-12 21:13 
Questionhave c++ version? Pin
Member 406720112-Mar-10 23:54
memberMember 406720112-Mar-10 23:54 
GeneralMy vote of 1 Pin
TimekeeperX29-Jan-09 23:24
memberTimekeeperX29-Jan-09 23:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04-2016 | 2.8.180314.2 | Last Updated 18 Sep 2007
Article Copyright 2007 by zebulon75018
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid