Code:Public Sub SetForeColor(Optional lForeColor As ColorConstants = vbBlack) Dim tCharFormat As CHARFORMAT2 With tCharFormat .cbSize = LenB(tCharFormat): .crTextColor = lForeColor: .dwMask = CFM_COLOR End With SendMessage RTB.hWnd, EM_SETCHARFORMAT, SCF_ALL, VarPtr(tCharFormat) End Sub




Reply With Quote