 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Stefan Guest
|
Posted: Fri May 19, 2006 10:14 am Post subject: Cancel TClientDataSet BeforeScroll |
|
|
Hello,
does somebody know a way to "cancel" a scroll-event and stay at the
current active row.
I have tried something with the BeforeScroll and AfterSroll events but I
did not find a nice solution for that.
Regards
Stefan |
|
| Back to top |
|
 |
Minas Guest
|
Posted: Sat May 20, 2006 10:14 am Post subject: Re: Cancel TClientDataSet BeforeScroll |
|
|
Hi Stefan ,
this might help you
in your form's private section add
TBookmark *myMark;
Button1 set a bookmark
Button2 releases the bookmark
I use the events of the DBGrid instead of Table's events (to avoid stack
overflow)
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
myMark = (TBookmark*)Table1->GetBookmark();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
Table1->FreeBookmark(myMark);
myMark=NULL;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::DBGrid1CellClick(TColumn *Column)
{
if (myMark)
Table1->GotoBookmark( myMark);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::DBGrid1KeyDown(TObject *Sender, WORD &Key,
TShiftState Shift)
{
if (myMark){
Key=0;
}
}
//---------------------------------------------------------------------------
regards
_minas
------
"Only virtue's conquests have certainty" Sofokleous Erephyle |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|