Solved

Limit text in CEdit control

Posted on 1997-10-22
3
463 Views
Last Modified: 2013-11-20
I've a CEdit control in a View derived from CFormView.
I've declared a variable m_edit, pointer to CEdit assigned in DoDataExchange.

I call the function m_edit.SetLimitText(LIMIT);
It doesn't works.

I've tried creating the control by myself and it was ok, but
I need to use the derived control instead of this.

Thanks
0
Comment
Question by:css
3 Comments
 
LVL 8

Accepted Solution

by:
gelbert earned 10 total points
ID: 1308607
Try to use ((CEdit*)GetDlgItem(ID_EDIT_CONTROL))->SetTextLimit(LIMIT) in OnInitialUpdate() for example, where ID_EDIT_CONTROL - is ID of your edit control in dialog template
0
 
LVL 3

Expert Comment

by:shaig
ID: 1308608
You can also set this value through the class-wizard, member variables page.
0
 
LVL 4

Expert Comment

by:jtwine100697
ID: 1308609
1) Make sure that you are doing a correct DDX_CONTROL in the DoDataExchange.

2) Remember that changing the text limit does not effect text that is already in the control, meaning, it will not truncate it.

-=- James.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

932 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

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now