VB for C++ Programmers

Variable declarations
Dim variableName as DataType

Dim varInt As Integer
Dim varString As String
Dim varInt16 as Short

Class Declarations

Public Class MyClass
         Implements someImplementationClass
         Private var2Class As String
         Private var2Class As Boolean
         Dim withEvents wordAppWithEvents As Word.Application

         Public Sub  New()
         End Sub

         Public Sub New(ByVal par1 As String, Optional ByVal par2 As Integer)
             'do something with this overloaded constructor 
        End Sub

        Private Function2Class As String
           Return "someString"
        End Function

         Public Sub publicVoidFunction
                'do something
         End Sub
End Class

C++: switch-> case

switch (variableInQuestion)
  case "variablevalue":
    //do something     
   case "varvalue2":
   case "varvlue3":
         //do something


in VB: 
select   varaibleInQuestion
case "variable value"
       'do something  
case "variable value2", "variablevalue3"
          'do something
case else
          'do nothing
end select

Useful utilities for string parsing (.Net)

C# : String[] dummy =   theString.Split("delimiter");
VB : Dim dummy as String() = theString.Split("delim"c)

C# : string nString = theString.Replace("OLD", "NEW");
VB : Dim nString as String = theString.Replace("OLD","NEW")

     string someString = String.Format("{0:c}", decimalValue);
     string someString = String.Format("${0:#,###.#0", decimalValue);
      Dim someString as String = FormatCurrency(decimalValue);
      Dim someString as String = System.String.Format("{0:c}", decimalValue);

      Dim someString as String = System.String.Format("${0:#,###.#0", decimalValue);

Simple conversion functions

Object to Decimal
Dim bal as Decimal = CDec(ObjVar)
Simple conversion functions 

Object to Decimal
decimal bal = Convert.ToDecimal(ObjVar); 

Casting : VB.Net

CType(Object As Expression, Object As Type)
CType(dataGrid.DataSource, System.Data.DataTable.DataView)
CType(class1, class2)

DirectCast(Object As Expression, Object As Type)
DirectCast(dataGrid.DataSource, System.Data.DataTable.DataView)
DirectCast(objectVariabl, String)

Casting : C#.Net

string str = (string)object;
integer int = (int)object;
definedClass class1 = (definedClass) object;

Button btn1 = object1 as Button;