MyBB Community Forums

Full Version: Anyone good converting C# to VB.NET?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Yeah, it also come down to how well the original code was formatted Toungue
(2011-04-02, 08:12 PM)Tom K. Wrote: [ -> ]ok, that seemed to work thanks Smile Now i just have another problem. In the C# code there is:

p.Blockchange += new Player.BlockchangeEventHandler(Blockchange1);

now, player.BlockchangeEventHandles in c# is:
public delegate void BlockchangeEventHandler(Player p, ushort x, ushort y, ushort z, byte type);
        public event BlockchangeEventHandler Blockchange = null;


In VB.NET that has converted to:
p.Blockchange += New Player.BlockchangeEventHandler(AddressOf Blockchange1)

and in the class:
Public Delegate Sub BlockchangeEventHandler(p As Player, x As UShort, y As UShort, z As UShort, type As Byte)
		Public Event Blockchange As BlockchangeEventHandler = Nothing

In C# it works fine, in vb.net it gives:
'Public Event Blockchange(p As Player, x As UShort, y As UShort, z As UShort, type As Byte)' is an event, and cannot be called directly. Use a 'RaiseEvent' statement to raise an event.

Anyone able to help? Its driving me mad...
Pages: 1 2 3