Articles   Members Online: 3
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to prevent the cursor from jumping to the start of a TDBMemo after setting t Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
28-Aug-02
Category
Database-VCL
Language
Delphi 2.x
Views
186
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas

I published the Charcase property of a TDBMemo, but have had a couple of problems. 
If I set the case to Upper or Lower sometimes, depending on what text is in the 
memo, no matter where I place the cursor and start typing (dataset in browse mode 
before this) the cursor jumps to the start of the memo and types there instead. 
Setting Charcase to normal corrects this. This only happens on a memo that is 
fairly full with text (the display area that is!). Any ideas why this is happening 
and how to stop it?

Answer:

This happens even in a normal TDBMemo. My solution is to use the OnEnter event of 
the TDBMemo:

1   { ... }
2   x := TDBMemo(Sender).SelStart;
3   if not (TDBMemo(Sender).DataSource.DataSet.State in dsEditModes) then
4     TDBMemo(Sender).DataSource.DataSet.Edit;
5   TDBMemo(Sender).SelStart := x;
6   TDBMemo(Sender).SelLength := 0;
7   { ... }


This seems to solve that problem entirely. First it stores the clicked on location of the memo, and you can see what the rest does.

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC