Solved

Entering text in text box

Posted on 1998-09-08
3
155 Views
Last Modified: 2013-11-20
Hi, I want to enter text, in a text box placed on a dialog, in 2 different ways. I have place buttons on the dialog, like windows phone dialer. I want that if I enter values thru buttons, it should enter the text at the positin where the cursor is blinking. Manual entry is OK in text box but when I press buttons, that's the problem.
Waiting for help...
0
Comment
Question by:Moin
  • 2
3 Comments
 
LVL 23

Accepted Solution

by:
chensu earned 20 total points
ID: 1321873
Call CEdit::SetSel to remove the current selection and call CEdit::ReplaceSel to insert the text.

CEdit::ReplaceSel
If there is no current selection, the replacement text is inserted at the current cursor location.
0
 

Author Comment

by:Moin
ID: 1321874
How will I use it, I have placed a control on the dialog box from toolbox.
0
 
LVL 23

Expert Comment

by:chensu
ID: 1321875
Use ClassWizard to add a member variable (m_edit) of type CEdit to associate the edit control.

In your button handler,

m_edit.SetSel(-1, 0);
m_edit.ReplaceSel(_T("insert"));
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Separate into files by filename 12 87
Shell script to login to remote m/c and execute commands 10 78
move a line in eclipse 3 107
sumHeights2  challenge 7 117
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question