Delphi Caret Position Tedit

Position Cursor in Edit control?

Hi All,

How do I position the cursor within an edit control? I've tried
SetCursorPos and SetCaretPos and they seem to have no affect.

Thanks,
Steve

Re:Position Cursor in Edit control?


Quote
teve Harp wrote:
> Hi All,

> How do I position the cursor within an edit control? I've tried
> SetCursorPos and SetCaretPos and they seem to have no affect.

Try the SelStart property.

Edit.SelStart

Sep 14, 2009 - How to get the physical caret position in a TMemo, TEdit or TRichEdit. How to get the caret position of a Memo or RichEdit control? I don't mean any character position. Original resource: The Delphi Pool. Also there you have the complete reference for edit: In code (no messages) you would do something like this. Solution 1) save the caret position before lines are added and scroll back to it afterward. Surround with a beginupdate endupdate to minimize flashing. I.e., save caret position beginupdate add lines scroll back to save caret position endupdate. Problem with this is I still get a flash once every block read (about 10- 20 lines). I presume the TextBox is not a Delphi component? – Francesca Oct 8 '10 at 5:16 The SendMessage function is an API and there is no rule to using windows APIs for our project only. For example we use this function to fill the yahoo messenger Textbox, Editbox, Box, Field. Totally: 'TextBox' is a virtual box on computer that we type on it.

Caret

Re:Position Cursor in Edit control?


I need to set the cursor to the end of the text or, if no text exists,
set it to the beginning ot the edit buffer. How is SelStart going to
help? In the OnEnter event of the control, I tried:

TEdit(Sender).SelStart := 0;

This had no affect on cursor position.

Steve

On Fri, 26 Apr 2002 11:00:40 -0500, Mauro Pati?o <M-Pat...@govst.edu>
wrote:

Quote
>teve Harp wrote:

>> Hi All,

>> How do I position the cursor within an edit control? I've tried
>> SetCursorPos and SetCaretPos and they seem to have no affect.

>Try the SelStart property.

> Edit.SelStart

Re:Position Cursor in Edit control?


Quote
Steve Harp wrote:
> I need to set the cursor to the end of the text or, if no text exists,
> set it to the beginning ot the edit buffer. How is SelStart going to
> help? In the OnEnter event of the control, I tried:

> TEdit(Sender).SelStart := 0;

> This had no affect on cursor position.

This does:

edit1.setfocus; //Needed if you are outside the edit
edit1.selstart:=0; //or whatever.

1. Text-cursor position within edit fields

Delphi Tedit Get Caret Position

2. Get cursor's position in Edit box ?

3. position of cursor in a edit box

4. Position cursor in edit box

5. Position of Cursor in Edit Box

6. Cursor position after edit on jet db

7. Calling an edit form from a BDGrid and inheriting the current cursor (record) position

8. Edit Box Cursor Position

Delphi Cursor Position In Tedit

9. set the cursor position on edit.text

Delphi Tedit Caret Position

10. Calling an edit form from a BDGrid and inheriting the current cursor (record) position