Solved

Limit text in CEdit control

Posted on 1997-10-22
3
488 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.

738 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