Visual Studio colors user-defined class differently in C# and in VB.net!

Category: visual studio editor

Question

biop.ms.technet on Mon, 27 Aug 2012 10:32:18


Hi all,

I am using Visual Studio 2008. I have to convert a C# program to VB.net program. I find out Visual Studio treat the non-Microsoft class (or user defined class) differently in C# and in VB.net!

In C#, the class EVTIADV_CenterTrigger_EventArgs is colored according to Tools -> Options -> Environment -> Fonts and Colors -> User Types. 

void BRIReader_EventHandlerCenterTrigger(object sender, EVTADV_CenterTrigger_EventArgs EvtArgs)
{
   if (EVTADV_CenterTrigger_EventArgs.STATE.PULLED == EvtArgs.CenterTriggerState)
   {
      ReadTags();
   }
}

In VB.NET, the class is colored as Identifier!

Private Sub BRIReader_EventHandlerCenterTrigger(ByVal sender As Object, ByVal EvtArgs As EVTADV_CenterTrigger_EventArgs)
   If EVTADV_CenterTrigger_EventArgs.STATE.PULLED = EvtArgs.CenterTriggerState Then
      ReadTags()
   End If
End Sub

Why? I am using VS2008 in Windows 7.