What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » problem getting the bg color in a RichTextBox

problem getting the bg color in a RichTextBox
Author: Message:
Mithrandir
Junior Member
**

ColorNick's creator

Posts: 85
Reputation: 3
37 / Male / –
Joined: Mar 2004
O.P. problem getting the bg color in a RichTextBox
I'm programming in VB6 and using the following code to retrieve the background color of the selected text in a RichTextBox:
code:
Public Function GetTextBackColor(ByVal rtfBox As RichTextBox) As Long
    Dim tCF2 As CHARFORMAT2
    tCF2.dwMask = CFM_BACKCOLOR
    tCF2.cbSize = Len(tCF2)
    Call SendMessage(rtfBox.hWnd, EM_GETCHARFORMAT, ercSetFormatSelection, tCF2)
    GetTextBackColor = tCF2.crBackColor
End Function

It works well, but when the background is not set (in that case we commonly see a white one), it returns 0; and it also returns 0 for a black background. So how can I make the difference between the two?

Please help me!
ColorNick v2 for MsgPlus 3 only: Official thread - Site & FAQ - Download
08-18-2004 04:40 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
problem getting the bg color in a RichTextBox - by Mithrandir on 08-18-2004 at 04:40 PM
RE: problem getting the bg color in a RichTextBox - by RaceProUK on 08-18-2004 at 09:53 PM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On