DTE2 and access to Fonts and Colors

Hi :)

I'm writing my own editor (and language service also) and now I need to be able to change colors of tokens (Identifiers) from my AddIn.

So I need somehow to access Tools->Options->Fonts and Colors from my code, and be able to change colors of choosen colorable items. (probably with use of DTE2)

But just don't know how to do it..I tried to find some examples on the net..., but I didin't suceed.

Pleas help me.., I'm running out of time (session ends..on my university)

Regards,

Pawel Zgoda



Answer this question

DTE2 and access to Fonts and Colors

  • Pavan Kurimilla

    You can get to the properties of an item through the FontsAndColorsItems interface. This macro will find the background and foreground color of the Plain Text item:

    Sub FontsColors()
    Dim prop As [Property]
    Dim fci As FontsAndColorsItems

    prop = DTE.Properties("FontsAndColors", "TextEditor").Item("FontsAndColorsItems")
    fci = prop.Object
    MsgBox(fci.Item("Plain Text").Foreground)
    MsgBox(fci.Item("Plain Text").Background)
    End Sub

    Craig



  • DTE2 and access to Fonts and Colors