Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TPageControl vs TTabSheet Rect 1

Status
Not open for further replies.

rcloutie

Programmer
May 26, 2005
164
CA
Hi there,

I've built my own PageControl (based on TPageControl) to display images on tabs area background (titles).

[images here]
|---|---|
| | | [images here]
|----------------------|
| |
| |
| |
|----------------------|
[images here]

All works fine. The problem is that inside each tab, a thin line (corresponding to the background image) appears between the PageControl border and each tab border. That is, if I increase BorderWidth property (which is 0 by default) of each tab, the line doesn't becomes larger but it still there.

So, the problem is drawing PageControl. The solution I thought of is to move the TabRect (Top-2; Left-2; Height+2; Width+2) and this way, maybe the line will be hidden.

The problem is how to do it. DrawTab event has a Rect parameter but it is related to the tabs area (titles).
How to get the entire TabSheet Rect to apply someting like InflateRect(TabRect, -2, -2);

Thanks for reply,

Rej Cloutier
 
Ah Ahh!

From DrawTab event:
TabRect.Left := -2;
TabRect.Top := Rect.Bottom+4;
TabRect.Right := Pages[iTab].Width+6;
TabRect.Bottom := Rect.Bottom + Pages[iTab].Height+4;
Canvas.FillRect(TabRect);

Thank you!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top