Prog1020
Prog1020

Reputation: 4781

SpTBX: tab control: how to owner-draw tab headers

TSpTbxTabControl. I need to owner-draw tab headers: a)draw colored line at top of header (misc color), b) draw some colored BG (not only draw themed BG).

I see only OnDrawBackground which uses rect for "lower" area(below headers), not rect for tab headers.

draw here

Upvotes: 0

Views: 379

Answers (1)

Prog1020
Prog1020

Reputation: 4781

Need to use OnDrawItem for tabs placed on tab control, TSpTbxTabItem. If tabs added at runtime, need to assign all (TabCtl.Toolbar.Items[i] as TSpTbxTabItem).OnDrawItem.

with SpTBXTabControl1.Toolbar do
for i:= 0 to Items.Count-1 do
  (Items[i] as TSpTbxTabItem).OnDrawItem:= SpTBXTabItem1DrawItem;

Upvotes: 3

Related Questions