Need help converting C# fragment to VB.NET

  • Thread starter Thread starter Ivan
  • Start date Start date
I

Ivan

I need to do custom column type for DataGridView and msdn has sample but
only for c#

I have problem converting this piece of code:

class MaskedTextBoxCell : DataGridViewTextBoxCell
{
private string mask;
private char promptChar;
private DataGridViewTriState includePrompt;
private DataGridViewTriState includeLiterals;
private Type validatingType;

public MaskedTextBoxCell() : base()
{
this.mask = "";
this.promptChar = '_';
this.includePrompt = DataGridViewTriState.NotSet;
this.includeLiterals = DataGridViewTriState.NotSet;
this.validatingType = typeof(string);
}


How do I write:
public MaskedTextBoxCell() : base()
in VB ?

Thank you,
Ivan
 
Ok. I got it. Since it's constructor - I made it "New" function and then
just called "MyBase.New()" as a first line

Now I have another one I can't tackle:

public class MaskedTextBoxEditingControl: MaskedTextBox,
IDataGridViewEditingControl
{

This implements MaskedTextBox AND IDataGridViewEditingControl
If I write "Implements" in VB.NET it complains that MaskedTextBox is not an
interface..

How do I rewrite this fragment?
 
Unfortunately, C# doesn't distinguish between inheriting and implementing in
the class header, so from the syntax alone you can't determine whether the
class is implementing 2 interfaces or inheriting a base class and
implementing 1 interface. However, in this case, the VB equivalent is:
Public Class MaskedTextBoxEditingControl
Inherits MaskedTextBox
Implements IDataGridViewEditingControl

--
http://www.tangiblesoftwaresolutions.com
C++ to C#
C++ to VB
C++ to Java
VB & C# to Java
Java to VB & C#
Instant C#: VB to C#
Instant VB: C# to VB
Instant C++: VB, C#, or Java to C++
 
Back
Top