Fede Invitado
|
Publicado: Mar 05 Mar, 2002 11:58 am Asunto: Enter / Tab en una DBGrid |
|
|
void __fastcall TForm1::FormKeyPress(TObject *Sender, char &Key) { if (Key == 13) { Key = 0; // Eat the Beep TDBGrid* DBGrid = dynamic_cast(ActiveControl); if (DBGrid) { if (DBGrid->SelectedIndex < DBGrid->FieldCount-1) DBGrid->SelectedIndex += 1; // next column else DBGrid->SelectedIndex = 0; // back to first } else // not (ActiveControl IS TDBGrid) SelectNext(ActiveControl, true, true); // Forward } else // not (Key = #13) if (Key == 2) SelectNext(ActiveControl, false, true); // Backward } |
|