If I try to color a Tree the background of items remain always white.
I have to obtain a tree of the same color of all others objects in a dialog.
Any trick?
info@marcoboschi.it
If I try to color a Tree the background of items remain always white.
I have to obtain a tree of the same color of all others objects in a dialog.
Any trick?
Marco,
Please review samples\TreeDlg.prg
Yes but background color of items remains White!
Saludos
METHOD ReDefine( nId, oWnd, nClrFore, nClrBack, lDesign, cMsg ) CLASS TTreeView
DEFAULT oWnd := GetWndDefault(),;
nClrFore := oWnd:nClrText,;
nClrBack := oWnd:nClrPane,; // GetSysColor( COLOR_WINDOW ),;
lDesign := .f.
...Antonio,
The answer is Yes.
=============== from ttreevie.prg ==============
METHOD ReDefine( nId, oWnd, nClrFore, nClrBack, lDesign, cMsg ) CLASS TTreeView
DEFAULT oWnd := GetWndDefault(),;
nClrFore := oWnd:nClrText,;
nClrBack := oWnd:nClrPane,; // GetSysColor( COLOR_WINDOW ),;
lDesign := .f.
Antonio, do you need a sample of this problem?
EMG
Enrico,
samples\TreeDlg.prg is working fine.
I appreciate if you could provide another sample, thanks ![]()
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, oTree
DEFINE DIALOG oDlg;
SIZE 400, 400
@ 0, 0 TREEVIEW oTree COLOR CLR_GREEN, CLR_RED
ACTIVATE DIALOG oDlg;
ON INIT FILLTREE( oTree );
CENTER
RETURN NIL
STATIC FUNCTION FILLTREE( oTree )
LOCAL oItem
oItem = oTree:Add( "Test" )
oItem:Add( "Test1" )
oItem:Add( "Test2" )
oItem:Add( "Test3" )
oTree:Expand()
RETURN NILThank to Yout Enrico and Antonio.
Enrico, Marco,
If you try to build a similar sample using Word VBA built in Macro Editor, it does not show the BackColor property. It looks as it is not supported by Windows API. We are doing more research.
Thank you very much
Muchas gracias
Grazie
Marco ![]()
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg, oTree
DEFINE DIALOG oDlg;
SIZE 400, 400
@ 0, 0 TREEVIEW oTree COLOR CLR_GREEN, CLR_RED
ACTIVATE DIALOG oDlg;
ON INIT FILLTREE( oTree );
CENTER
RETURN NIL
STATIC FUNCTION FILLTREE( oTree )
LOCAL oItem
oItem = oTree:Add( "Test" )
oItem:Add( "Test1" )
oItem:Add( "Test2" )
oItem:Add( "Test3" )
oTree:Expand()
TVSETTEXTCOLOR( oTree:hWnd, CLR_GREEN )
TVSETBKCOLOR( oTree:hWnd, CLR_RED )
RETURN NIL
#pragma BEGINDUMP
#include "windows.h"
#include "commctrl.h"
#include "hbapi.h"
HB_FUNC( TVSETTEXTCOLOR )
{
hb_retnl( ( LONG ) TreeView_SetTextColor( ( HWND ) hb_parnl( 1 ), hb_parnl( 2 ) ) );
}
HB_FUNC( TVSETBKCOLOR )
{
hb_retnl( ( LONG ) TreeView_SetBkColor( ( HWND ) hb_parnl( 1 ), hb_parnl( 2 ) ) );
}
#pragma ENDDUMPVery good!
After dinner I'll try it!
Thanks again