converting vba to .net

Discussion created by msteinbrenner on Jan 24, 2011
Latest reply on Apr 18, 2012 by AliceShepherd
I am sure many of you are in the same boat:

I am just starting to try to convert my vba code to .net. I have begun with a very simple routine that basically just adds a start and end point to a route features we frequently make here at work.

I am having a difficult time figuring out what to do when things are labeled undeclared or undefined in Visual Studio.

For example here is a piece of the code below that defines the start point text and alignment. I have put the Visual Studio errors in the comments to the right of the variables:

   '+++ Define the START Text Symbol
        Dim pTextSymbol As ITextSymbol
        pTextSymbol = New TextSymbol

        pTextSymbol.HorizontalAlignment = esriTHARight 'not declared
        pTextSymbol.VerticalAlignment = esriTVABottom 'not declared

        Dim myFont As IFontDisp 'not defined
        myFont = New StdFont 'not defined
        myFont.Name = Arial 'not declared
        myFont.size = 18
        myFont.Bold = True
        pTextSymbol.Font = myFont 'Reference required to assembly blahblah

        Dim pRGBColor As IRgbColor
        pRGBColor = New RgbColor
        pRGBColor.Red = 163
        pRGBColor.Green = 255
        pRGBColor.Blue = 115
        pTextSymbol.Color = pRGBColor

        Dim pMask As IMask
        pMask = pTextSymbol
        pMask.MaskStyle = esriMSHalo 'not declared
        pMask.MaskSize = 0.5
        pTextSymbol = pMask

If someone could help me to figure out how to redefine and redeclare these things so they would work in Visual Studio I would be very appreciative. There seems to be very little documentation regarding this topics like this anywhere on the interent currently but hopefully I am just missing something obvious and one of you can get me started down the right path.