Víctor Lara Santillán

Concatenating strings

When using c# I used:
string test = "1";
test = "1" + "2"; // test should be 12;

In VB translation it gives:
test = "1" + "2";

this should be:
test = "1" & "2";
Feedback by Víctor Lara Santillán Status: Not Done Comments: 0 Last update: 2015-02-18T14:51:21 by Víctor Lara Santillán
Serkan Güncan

cursor , ico

Bitmap bmp = new Bitmap("sineklik.png");
ico == Icon.FromHandle(bmp.GetHicon); ---> why does it make mistakes?
customCursor = new Cursor(ico.Handle);
this.UseWaitCursor = false;
this.Cursor = customCursor;
Problem by Serkan Güncan Status: Not Done Comments: 0 Last update: 2015-02-16T12:44:41 by Serkan Güncan
Steve Florence

C# event handlers not converting correctly - problem still exists

Converting this simple code, the converter incorrectly converts this:
cbo.Validating += new CancelEventHandler(cbo_Validating);
as this
cbo.Validating += New CancelEventHandler(cbo_Validating)
All it did was to remove the ";"

It should have returned the VB code as:
AddHandler cbo.Validating, AddressOf Me.cbo_Validating

The odd part is that sometimes this converter gets it right.

Snippet trying to convert:
void dataGridView1_EditingControlShowing(object sender, DataGridViewEditingControlShowingEventArgs e)
if (e.Control.GetType() == typeof(DataGridViewComboBoxEditingControl))
DataGridViewComboBoxEditingControl cbo = e.Control as DataGridViewComboBoxEditingControl;
cbo.DropDownStyle = ComboBoxStyle.DropDown;
cbo.Validating += new CancelEventHandler(cbo_Validating);
Feedback by Steve Florence Status: Not Done Comments: 0 Last update: 2015-02-03T19:14:19 by Steve Florence
Steve Florence

eventhandler code conversion error

C# Input:
this.Layout += new System.Windows.Forms.LayoutEventHandler(this.ComboBoxTree_Layout);

VB.NET Ouput:
Me.Layout += New System.Windows.Forms.LayoutEventHandler(Me.ComboBoxTree_Layout)

VB.NET ouput should be:
AddHandler Layout, AddressOf Me.ComboBoxTree_Layout
Feedback by Steve Florence Status: Not Done Comments: 0 Last update: 2015-01-16T17:19:48 by Steve Florence
Joe Farrell

Implicit variable type changes from C# to VB.NET

C# Input:
var x = 5 / 3;

Actual VB.NET Output:
Dim x = 5 / 3

Suggested VB.NET Output:
Dim x = 5 \ 3

The C# code declares an int whose value is 1. The VB.NET code currently generated by the converter declares a double whose value is 1.6666667.
Feedback by Joe Farrell Status: Not Done Comments: 2 Last update: 2015-01-13T17:51:37 by Joe Farrell
Steve Florence

lambda expression

When will this converter have the ability to convert lambda code?
Tried this:

protected override void OnStart(string[] args)
EventLogger.Write("Starting service!");
ThreadPool.QueueUserWorkItem( _ => {
new VirtualServerInit(EventLogger).Run();
EventLogger.Write("VirtualServerInit code was executed");

and it failed
Feedback by Steve Florence Status: Not Done Comments: 0 Last update: 2015-01-07T17:25:04 by Steve Florence
David Perish

c# using statement with initializer won't convert, but VB to C# will work

This code will convert from VB to C#, but not vise-versa:

// C#
using (Obj x = new Obj {a == 1,b == 2}) {

' VB.Net
Using x As New Obj With { a = 1, b = 2}
End Using
Problem by David Perish Status: Not Done Comments: 0 Last update: 2014-12-19T15:31:03 by David Perish
JumpMan Jones


Add web-service so that conversion of code can be done without having to hit the website. It would be cool to have a plugin within visual studio that also converted code .
Idea by JumpMan Jones Status: Not Done Comments: 0 Last update: 2014-12-16T20:03:10 by JumpMan Jones
David Sherwood

vb to c# converted a declaration with dynamic instead of var

The Vb code was:
Dim mIncludedItems = aItems.Where(Function(x) pSelectionFilterers.All(Function(y) y.IsFilteredIncluded(x)))
and the C# code was:
dynamic mIncludedItems = aItems.Where(x => pSelectionFilterers.All(y => y.IsFilteredIncluded(x)));

"dynamic" should be "var"
Feedback by David Sherwood Status: Not Done Comments: 1 Last update: 2014-12-08T14:59:49 by Matthieu Penant
Frank Lenoir

Conversion error From, Order By and Select clauses

The following C# code converts incorrect to VB

This C# code:
public string[] CustomPropertyNames
return (from p in _customProps orderby p.Key ascending select p.Key).ToArray();

converts to:
Public ReadOnly Property CustomPropertyNames() As String()
Return (From p In _customPropsOrder By p.Key Ascendingp.Key).ToArray()
End Get
End Property

The result should be:
Public ReadOnly Property CustomPropertyNames() As String()
Return (From p In _customProps Order By p.Key Ascending Select p.Key).ToArray()
End Get
End Property

Frank Lenoir
Problem by Frank Lenoir Status: Not Done Comments: 0 Last update: 2014-11-20T10:48:04 by Frank Lenoir
Displaying items 61 - 70 of 93