1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
   | void __fastcall TForm1::StringGrid2KeyPress(TObject *Sender, char &Key)
{
 
  int i;
  if(StringGrid2->Cells[c2][0].Length() > 1) Key=NULL;
  if (Key < '0' || Key >'1')  Key = NULL;
 
   i=c2*10+10;
 
  TPoint pt_mem,pt,pt_click;
        pt_click.x=i;
        pt_click.y=300;
 
        pt_mem=Mouse->CursorPos;
        pt=StringGrid1->ClientToScreen(pt_click);
        Mouse->CursorPos=pt;
        mouse_event(MOUSEEVENTF_LEFTDOWN,pt.x,pt.y,0,0);
        mouse_event(MOUSEEVENTF_LEFTUP,pt.x,pt.y,0,0);
        Mouse->CursorPos=pt_mem;
        if(i==320) c2=0;
} |