EnableMethodErrors (ImageList Control) example for C++ Builder
void __fastcall TForm1::LEADImgList1Click (TObject *Sender)
{
long lIndex ;
TPoint MousePoint;
GetCursorPos(&MousePoint);
MousePoint = LEADImgList1->ScreenToClient(MousePoint);
if( LEADImgList1->AllowSelection == ALLOWSELECTION_NONE) /*manual selection?*/
{
LEADImgList1->EnableMethodErrors= False;
lIndex = LEADImgList1->HitTest (MousePoint.x,MousePoint.y); /*did we hit an item?*/
LEADImgList1->EnableMethodErrors= True;
if( ((lIndex >= 0) && (lIndex < LEADImgList1->Count)))
{
/* set item as selected*/
LEADImgList1->SelectAll (False);
LEADImgList1->Item [lIndex]->Selected = True; /*make sure the item is selected*/
}
}
}