Solved

Limit text in CEdit control

Posted on 1997-10-22
3
495 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

636 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