完善Borland C++ Builder可视化控件功能三例
王光红
笔者在编程中积累了点滴经验,与各位交流,共同提高。
一. 让PageControl的TabSheet“弹出来”
弹出来的效果 |
![](/Develop/ArticleImages/19/19512/CSDN_Dev_Image_2003-7-71422180.png)
用过PageControl的人知道,PageControl之ActivePage的标头较“平坦”,没有“弹出”的立体效果,笔者经过改进达到了“弹出”的效果。
在OnDrawTab事件中加入以下代码:
void __fastcall TSqlBuilderForm::PageControl1DrawTab(
TCustomTabControl *Control, int TabIndex, const TRect &Rect,
bool Active)
{
Byte Red0,Red1,Green0,Green1,Blue0,Blue1;
if(Active)
{
Red0 = 0;
Red1 = 15;
Green0 = 55;
Green1 = 200;
Blue0 = 135;
Blue1 = 240;
}
else
{
Red0 = 51;
Red1 = 101;
Green0 = 91;
Green1 = 200;
Blue0 = 91;
Blue1 = 200;
}
int h;
h = Rect.Bottom - Rect.Top - 2;