Solved

Limit text in CEdit control

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

758 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

21 Experts available now in Live!

Get 1:1 Help Now