Steve Florence


VB-NET to C#. Converter has incorrect output with My.Resources

VB Input:
Me.pboxOverallStatus.Image = My.Resources.ProgressBar_25_Mod

C# ourput:
Spits out this: this.pboxOverallStatus.Image == My.Resources.ProgressBar_25_Mod
which is plain wrong. "My" does not exists.
Feedback by Steve Florence Status: Not Done Comments: 0 Last update: 2016-04-21T22:29:47 by Steve Florence
Chris Langsenkamp

VB Select Case Conversion

Please stop converting VB's Select Case to C#'s switch block. The latter only allows constants for the cases, whereas Select Case is far more powerful / flexible. Convert to If...elseif...elseif...else ladder instead.
Problem by Chris Langsenkamp Status: Not Done Comments: 1 Last update: 2016-04-17T15:55:21 by Chris Langsenkamp
Nicholas De La Haye

DirectCast of IntPtr for VB .net

C# sharp original code
buffer = (IntPtr)(buffer.ToInt32() + (Index*Marshal.SizeOf(typeof(TRACK_DATA))));

Converts to VB .net:
buffer = DirectCast(buffer.ToInt32() + (Index * Marshal.SizeOf(GetType(TRACK_DATA)), IntPtr)

You can not perform a direct cast from Tnteger to IntPtr type in this way! You must you the following (i.e. New IntPtr(YourIntegerValue)

buffer = New IntPtr(buffer.ToInt32() + (Index * Marshal.SizeOf(GetType(TRACK_DATA))))

Problem by Nicholas De La Haye Status: Not Done Comments: 0 Last update: 2016-04-08T14:19:46 by Nicholas De La Haye
Rita Chavda

conversion error

convesion from vb to c# we neeed table(0) to table[0] conversion and same for row(0) to row[0]
Problem by Rita Chavda Status: Not Done Comments: 0 Last update: 2016-03-14T05:27:04 by Rita Chavda
Rickey Ward

for loop iterators not assigned

When a loop from VB to C# is converted, the for loop lacks an identifier for the for loop variable. I have to manually add "int" before the variable name.

Is this intentional so you have to verify the types? or an oversight?
Problem by Rickey Ward Status: Not Done Comments: 0 Last update: 2016-03-08T19:41:16 by Rickey Ward
Vishakha Baghel

plz have facility of converting c# code into c++ code

Feature Request by Vishakha Baghel Status: Not Done Comments: 0 Last update: 2016-03-07T10:57:55 by Vishakha Baghel
Damien Vande Kerckhove

Object Initializer C# to

The converted code doesn't compile :

C# code to convert :

return new MyObject{
Name = name,
Length = length,
Width = width
}; result code

Return New MyObject() With { _
Key .Name = name, _
Key .Length = length, _
Key .Width = width _

The remove of the keyword "Key" fix the problem

Problem by Damien Vande Kerckhove Status: Not Done Comments: 0 Last update: 2016-02-29T16:47:31 by Damien Vande Kerckhove
Paul Forveille

Add Event Handler


For your code converter, there is a little problem that you should consider.
To add an event handler in C#, it is like so :
obj.xEvent += new EventHandler<EventArgs>(obj_xEvent);
Your converter convert it like this :
obj.xEvent += New EventHandler(Of EventArgs)(obj_xEvent)

But in VB, it's really far from it. You have to do this like so :
AddHandler Obj.XEvent, AddressOf Me.XEventHandler

Can you correct this issue ?
Problem by Paul Forveille Status: Not Done Comments: 0 Last update: 2016-01-03T18:28:33 by Paul Forveille
Tom Johnson

"string.right" {Strings.Left(full_name, 2), Strings.Right(full_name, full_name.Length - 3)}
converts to
c#: { full_name.Substring(0, 2), full_name.Substring(full_name.Length - 3) }

Strings.Left is correct.
Strings.Right is WRONG! Strings.Right(full_name, full_name.Length - 3)
should convert to:
c#: full_name.Substring(3)
should return all but first three chars of string
Problem by Tom Johnson Status: Not Done Comments: 0 Last update: 2016-01-03T09:38:59 by Tom Johnson
Antonio Lopes

Check EventHandler event is null (nothing)

C# version
public event EventHandler SendToPLC;
private void barcodeTextBox_KeyPress(object sender, KeyPressEventArgs e)
if (e.KeyChar == '\r')
if (SendToPLC != null)
SendToPLC(sender, e);
e.Handled = true;
VB.NET version
Public Event SendToPLC As EventHandler
Private Sub barcodeTextBox_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs)
If e.KeyChar = ControlChars.Cr Then
'If SendToPLC IsNot Nothing Then
'MISSING "EVENT" on end of Event Name. !@#@@^#%. WHY THIS?
If SendToPLCEvent IsNot Nothing Then
RaiseEvent SendToPLC(sender, e)
e.Handled = True
End If
End If
End Sub

Very thanks by Free converter

Feedback by Antonio Lopes Status: Not Done Comments: 0 Last update: 2015-10-02T06:45:14 by Antonio Lopes
Displaying items 31 - 40 of 87