//---------------------------------------------------------------------------
void __fastcall
TForm1::PageControl1Changing(TObject *Sender, bool &AllowChange)
{
TC_HITTESTINFO
hti;
POINT
P;
int
tab_index;
GetCursorPos(&P);
P
= PageControl1->ScreenToClient(P);
hti.pt.x
= P.x;
hti.pt.y
= P.y;
tab_index
= PageControl1->Perform(TCM_HITTEST, 0, (LPARAM)&hti);
//
prevent first tab from being selected for example...
if
(tab_index == 0) AllowChange = false;
}
|