mfc >> Adding text at the cursor position in Edit Box

by Abhimanyu » Wed, 03 Dec 2003 15:26:19 GMT

Hi everboy,

I am using a Application in which user insert something in
the Edit Box. The inserted text added at the end of the
Edit box because i do the following:

m_editBoxBody = m_editBoxBody + text_to_beAdded.

Now i want to modify it so that it insert the text at the
line where the cursor is there, not at the last.

Can u plz suggest me how to accomplishe thsi Task.

Thanks in advance.

bye
Abhimanyu


mfc >> Adding text at the cursor position in Edit Box

by David Lowndes » Wed, 03 Dec 2003 16:15:14 GMT


>...

Use CEdit::ReplaceSel.

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq



mfc >> Adding text at the cursor position in Edit Box

by Abhimanyu » Wed, 03 Dec 2003 17:08:49 GMT

Thanks dave,
but i m not selecting any thing will it work? I just want
to insert the text at that cursor position shifting other
text down.

Abhimanyu

the


Similar Threads

1. inserting text at mouse position in text or rich edit box - CSharp/C#

2. disable blinking cursor and selected text in edit box

Hi!

I'm using mfc to create a dialog with an edit box in it, to which I
write text after an event occurs. Everything works the way I want,
except that the text comes out highlighted and the cursor is blinking
irritatingly at the end of the line. I looked everywhere on the web to
find a way to disable these two but couldn't find a way. Can someone
tell me how to disable the cursor and to not have selected text
printed in the edit box?

thanks, 
Craig

3. Show text at end of edit box after edit.text := - Delphi VCL Component

4. My edit box, won't allow typing of more text bigger than text box

(wtl)

My edit box is derived this way.

class CEditQuery : public CWindowImpl<CEditQuery, CEdit>



I create it this way



m_EditQuery.Create(m_hWnd, rc2, NULL, WS_CHILD | WS_TABSTOP | WS_VISIBLE |
WS_BORDER);

m_EditQuery.SetFont((HFONT)GetStockObject( DEFAULT_GUI_FONT ));

m_EditQuery.SetLimitText(1000);  < ---  even though I call this, the amount
of text I can enter is limited to size of text box, why ???



Why can't I enter more text than what's visible? Am I missing a simple
window style setting??




5. set cursor position in an edit control

6. text cursor position

Hi,

I need to get the text cursor position in a richedit Control, ie I want my
ContextMenu to appear exactly where the user is typing text,


Thanks


7. Position text cursor

8. valuelisteditor cell cursor position for inserting text

Hi,

I'm trying to insert text at the cursorlocation in a selected cell in the 
valuelisteditor.

When my valuelisteditor.cells[1,1] contains 'abde' and I move the cursor to 
the position behind the 'b' I would like to insert 'c'.
So that the contents of the valuelisteditor.cell [1,1] get to be 'abcde'. 
Is there something like seltext for those valuelisteditor.cells?

Can you help me?

Ineke