Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

List-View control label editing problem

Posted on 1998-05-26
3
Medium Priority
?
204 Views
Last Modified: 2013-12-03
I have a list-view control, its labels can be edited by the user. However, after typing just one character, Windows thinks I'm done, for some reason, sends a WM_NOTIFY with LVN_ENDLABELEDIT or whatever it's called, and, oddly enough, sends a WM_COMMAND with command identifier 1 (IDOK).
I think it thinks I canceled the editing, but I did not.

Using Windows NT and MSVC.
0
Comment
Question by:_Zaphod
3 Comments
 
LVL 11

Expert Comment

by:alexo
ID: 1404202
Check your "break" statements.
0
 
LVL 1

Author Comment

by:_Zaphod
ID: 1404203
That indeed was the obvious thing to do. It's not the problem though, because I placed a breakpoint there, and the values really were WM_COMMAND and 1.
0
 
LVL 7

Accepted Solution

by:
BlackMan earned 200 total points
ID: 1404204
It is possible to limit the amount of text the user may enter. If this in some way has been set to 1 (default is 30000), you'll get the result you describe.
Try setting the limit using the EM_LIMITTEXT message and see if that will do the trick.

EM_LIMITTEXT
wParam = (WPARAM) cchMax;   // text length, in characters
lParam = 0;                 // not used; must be zero
 
Parameters
cchMax
Value of wParam. Specifies the maximum number of characters the user can enter. If this parameter is zero, the text length is set to 0x7FFFFFFE characters for single-line edit controls or 0xFFFFFFFF for multiline edit controls.

0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

926 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