Link to home
Start Free TrialLog in
Avatar of Diono
Diono

asked on

Tab Custom Draw

Hi all,

I draw the Tab(the part you click on to select another sheet) as below. Problem is, I can't get it to draw the _ below the shortcut character.

The result is:-
  '&Customer'

Thanks,
Dion.

procedure TPupilForm.pcFamDetailsDrawTab(Control: TCustomTabControl;
  TabIndex: Integer; const Rect: TRect; Active: Boolean);
var
  ARect: TRect;
begin
  with Control do
  begin
    if Active then
      Canvas.Brush.Color := RGB(195, 193, 205)
    else
      Canvas.Brush.Color := clBtnFace;

    ARect := Rect;
    ARect.Bottom := ARect.Bottom+2;
    Canvas.FillRect(ARect);

    Canvas.Font.Color := clBlack;

    { make sure that the tab is going to be wide enough. }

    Canvas.TextOut(Rect.Left+4, Rect.Top+4, TPageControl(Control).Pages[TabIndex].Caption);

  end;
ASKER CERTIFIED SOLUTION
Avatar of fva
fva

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial