修改 PageControl 控件的 TAB 按钮的文字与颜色
首先将pagecontrol 的ownerdraw 设为true
再在它的onDrawTab事件里写如下代码:
var TmpRect: TRect; begin with PageControl1.Canvas do begin Brush.Color := $00E6F6F8; Font.Color := clblack; FillRect(Rect); TmpRect := Rect; OffsetRect(TmpRect, 0, 3); DrawText(Handle, PChar(PageControl1.Pages[TabIndex].Caption), -1, TmpRect, DT_CENTER or DT_VCENTER); end; end;