I'm trying to colorize the background of a tab control (NOT using DDT). I tried using a DDT example but it doesn't work when creating a window with createwindow...
I have no problem changing the color of the actual tab (on top), but the window underneath it is the problem!
This is how I'm trying to do it:
This part works great (the actuual tab):
The drawtabbackground:
Any ideas???
[/CODE]
I have no problem changing the color of the actual tab (on top), but the window underneath it is the problem!
This is how I'm trying to do it:
Code:
case %wm_erasebkgnd ''draw tabs with a differnt gradient background color hdc&=wparam& pg&=getcurseltab(htab&) drawtabbackground hdc&,hwnd&,pg& function=1 exit function
Code:
case %wm_drawitem if wparam&=1000 then ''tab control disptr=lparam& pgnum&[email protected] bcolor&=rgb(128,128,255) if @disptr.itemstate=%ods_selected then @[email protected]+2 fcolor&=rgb(255,255,255) else fcolor&=rgb(0,0,0) end if hbrush&=createsolidbrush(bcolor&) selectobject @disptr.hdc,hbrush& settextcolor @disptr.hdc,fcolor& setbkcolor @disptr.hdc,bcolor& fillrect @disptr.hdc,@disptr.rcitem,hbrush& ti.mask=%tcif_text ti.psztext=varptr(ztext) ti.cchtextmax=sizeof(ztext) call tabctrl_getitem(getdlgitem(hwnd&,wparam&),@disptr.itemid,ti) style&=%dt_singleline or %dt_center or %dt_top drawtext @disptr.hdc,ztext,len(ztext),@disptr.rcitem,style& deleteobject hbrush& function=1 exit function end if
Code:
sub drawgradient(byval hdc&,byval hwnd&,byval pgnum&) dim rc as rect getclientrect hwnd&,rc bcolor&=rgb(128,128,255) hbrush&=createsolidbrush(bcolor&) fillrect hdc&,rc,hbrush& deleteobject hbrush& end sub
[/CODE]
Comment