Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 12-15-2003, 01:20 PM
Derek Derek is offline
Senior Member
 
Join Date: Jun 2002
Posts: 559
Default Getting the caret position of a TEdit

Hi there. I need to know how to get the x-value of the position of the blinking cursor in a TEdit. I saw that there was no CaretPos property like in a TMemo and I cant use a TMemo as a TEdit in this case

Any help would be greatly appreciated (will accept)

Please accept if helped

[b]
A carelessly planned project takes 3 times longer to complete than expected; A carefully planned project takes only twice as long :-)

Derek )
Reply With Quote
  #2  
Old 12-15-2003, 01:43 PM
Derek Derek is offline
Senior Member
 
Join Date: Jun 2002
Posts: 559
Default Don't worry, got it! :)

Just went and looked how they did it with a TMemo. Actually real easy

Please accept if helped

[b]
A carelessly planned project takes 3 times longer to complete than expected; A carefully planned project takes only twice as long :-)

Derek )
Reply With Quote
  #3  
Old 12-15-2003, 10:25 PM
adixtopix adixtopix is offline
Senior Member
 
Join Date: Oct 2003
Posts: 730
Default RE: Don't worry, got it! :)

try something



procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if ord(key)=vk_back then
if pos<>0 then pos:=pos-1;
if ord(key)<>vk_back then pos:=pos+1;
end;

__________________________________________________ _________
A D I X T O P I X

adixtopix@yahoo.com
__________________________________________________ _________
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 07:27 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.