Delphi Caret Position Tedit

  

Board index » delphi » TEdit again. Delphi Developer. Thu, 09 Aug 2007 23:43:41 GMT. Hi folks, is it possible to get the caret position in a tedits 'OnChange' event handler? I tried to find similar property/'get.' Method but there is none listed. I would appreciate if. Delphi Caret Position Tedit. 9/13/2019 So the array must be word aligned. (That's where the normal bitmap probably goes wrong.)We use 1 for the cPlanes and 1 for the cBitsPerPel. So even for 8 pixels ( 1 byte) we still need a Word to have Word aligned.For 4 pixels wide we would only need $0F. Mar 12, 2003 - Moving the cursor inside the. 1 Comment 1 Solution 862 Views Last Modified:. Hi, How can I get cursor position in TEdit control? 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. How to focus a TEdit with cursor at end of text. How to move cursor at end of text. Brain Stall - Move cursor to end of RichEdit. Moving Cursor between TEdit's. Moving the cursor in TEdit. Moving the cursor in a TEdit window. Move cursor in TEdit box. Set cursor/caret at end of text? Select text from end of cursor.

Delphi tedit get caret position

TEdit Cursor Position

I am looking for a way to be able to determine the position of the cursor
with in a TEdit so that I can insert text at that location. Any
suggestions?

If the built in TEdit would not support it could I create a new component
(inherited from TEdit, I assume) with that ability?

I am using Delphi 5.

Thanks in advance.

Donovan

Tedit

Re:TEdit Cursor Position


I have used the following code to mask the text entered into
the TEdit control, so that only positive integers could be used.
I put the call to this in the OnKeyUp event like this:
MaskPositiveIntegerNumbers(Edit1);

This was what the customer wanted and they did not want the
MaskEdit control.

procedure TForm.MaskPositiveIntegerNumbers(Sender : TObject);
var
strTemp : string;
i : integer;
begin
strTemp := (Sender as TEdit).Text;
for i := length(strTemp) downto 1 do
if ( ((Integer(strTemp[i]) < Integer('0')) or
(Integer(strTemp[i]) > Integer('9'))) ) then
begin { not a number so delete last character }
delete(strTemp,i,1);
(Sender as TEdit).SelectAll;
(Sender as TEdit).SelText := strTemp;
end;
end;
//
//
//

Caret

Re:TEdit Cursor Position


Quote
'Donovan Rogers' <drog...@grouplink.net> wrote in message
news:3da1dfdd$1@newsgroups.borland.com...
Quote
> I am looking for a way to be able to determine the position of the cursor
> with in a TEdit so that I can insert text at that location. Any
> suggestions?
'SelText := 'New inserted text' replaces the selection or inserts text at
caret if there is zero-length selection.

SelStart should return the position of the caret (if the caret is what you
meant by 'cursor').

--
Alex Yackimoff

Delphi

Re:TEdit Cursor Position


Donvan,
Quote
> That worked great. Thanks. Also, I have never heard it calleda caret; I
> thought this ^ was a caret. Anyway, it worked. Thanks again.
Ahhh... Time for a Windows terminology lesson. <g>

The mouse pointer is called a cursor. The I-beam that you see in an
edit or memo control is called a caret, as is the shifted-6 '^'.

Keeping cursor and caret sorted out helps when you're looking for
an API routine or asking a newsgroup question. :-)

Ken
---
Ken White
kwh...@adpsi.com

Clipper Functions for Delphi and C++ Builder
http://www.adpsi.com

1. TEdit: cursor position control in a blank text.

2. TEdit - cursor position available ?

3. TEdit-Cursor position

Delphi cursor position in tedit

4. TEdit - How to get the cursor position

5. Help! Cursor Position in TEdit

6. Cursor position TEdit

7. cursor position in TEdit component

8. Changing cursor position in TEdit

Delphi Tedit Get Caret Position

9. TEdit - controlling cursor position

Delphi Cursor Position In Tedit

10. Cursor position in tEdit

Delphi Tedit Caret Position