BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cancel TClientDataSet BeforeScroll

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage)
View previous topic :: View next topic  
Author Message
Stefan
Guest





PostPosted: Fri May 19, 2006 10:14 am    Post subject: Cancel TClientDataSet BeforeScroll Reply with quote



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





PostPosted: Sat May 20, 2006 10:14 am    Post subject: Re: Cancel TClientDataSet BeforeScroll Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (VCL Components Usage) All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.