Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Text Color - SysTreeView32
#1
Hi,

How can I set the text color on a tree view ?

See Attached Image.


Attached Files Image(s)
   
#2
Google for "TVM_SETTEXTCOLOR".
#3
This works too !

One followup question....Is there a way to define font/color/style for each line of a treeview ??

Thx in advance
#4
Oh...and also...

How do I define TVM_SETBKCOLOR value (4381&)?
#5
Step1. Check Options -> Files -> Use optional reference files.
Step2. In editor type TVM_SETBKCOLOR, press F2 or Ctrl+Click, and copy/paste the definition.

If you have QM 2.2.0, you don't need to define it. Or you can do Step2.

In both cases you can use it without definition by typing "WINAPI." before:

WINAPI.TVM_SETBKCOLOR
#6
Yup...got it...

Any clues on my previous question....different text attributes on different lines of tree view ?
#7
Is it in a custom dialog that you created in QM, or is it in another app?

Explorer-style dialog
#8
Yes...its working...i have a custom dialog

Since, data is loaded dynamically, how do i force a refresh on the tree to reflect the colors... I modified DEX_TvCustomDraw as follows :

Code:
Copy      Help
/DEX_Main
function# NMTVCUSTOMDRAW*cd

out cd.nmcd.dwDrawStage
sel cd.nmcd.dwDrawStage
    case CDDS_PREPAINT ret CDRF_NOTIFYITEMDRAW ;;yes, notify me to draw items
    case CDDS_ITEMPREPAINT
        if cd.nmcd.lItemlParam > 0 and Mail_Data_Loaded = 1
            if Mail_Data_Folders_Unread[cd.nmcd.lItemlParam-1] != "0"
                cd.clrText = 0xFF0000
            else
                cd.clrText = 0x000000
        else
            cd.clrText = 0x000000
    case else ret
#9
another question related to this...

How do I change the "Selection" row text colors ?

Tried a few combinations...not working :-(
#10
To repaint a control, can be used RedrawWindow. Example:

RedrawWindow(id(4 hDlg) 0 0 RDW_INVALIDATE)

Not sure if it is possible to change selected item colors. Unsuccessfully tried in the past.
#11
Thx for all the help, Gi
#12
With treeview: is there a way to set the colors of folders and subfolders via regex of the folder names?


Forum Jump:


Users browsing this thread: 1 Guest(s)