Thanks for the prompt reply. How do I use this?
Using:gives 889851594 and 889851594 where Text1 has black text and Text2 has red text.VB Code:
Debug.Print SendMessage(Text1.hwnd, WM_GETFONT, 0&, 0&) Debug.Print SendMessage(Text2.hwnd, WM_GETFONT, 0&, 0&)
Could you give me a simple example of just changing the forecolour to red?
EDIT:
Just reading around a bit, and it seems like there is no colour associated with font. If I were to use SetTextColor, how do I get the device context of the TextBox?
EDIT 2:
Reading around further, came up with the following:
However, this does not work. Still not sure why...VB Code:
Dim lngMainTexthDC As Long lngMainTexthDC = GetDC(txtMainText.hwnd) SetTextColor lngMainTexthDC, RGB(255, 0, 0)




Reply With Quote