I have produced a CIPEdit class ( Similar to the IP Address Edit control in
the Windows 'NT / 95 control Panel ). I would like to allow in - place
editing within a CListCtrl using this new Edit Control Class. I am however
having problems replacing the default CEdit control used by the CListCtrl
component.
Any suggestions welcome.
Simon Fogg.
Simon Fogg wrote in message ...
Handle NM_CLICK WM_NOTIFY message sent to parent of list control, inside
this handler call CListCtrl::EditLabel. This function returns pointer to
created edit control. Then you can subclass
it with SubclassWindow and handle message in your CEdit derived class.
Alternatively you can create your own edit. Look at "code guru" site at
http://www.codeguru.com/listview/drop_down_list.shtml, there is a sample
which
shows how to create combobox on subitem. You should slightly modify code to
create your own edit
instead of combo.
Alexander Galkin
Software Engineer
Zebra Pushware Solutions, Inc.
E-mail: sa...@zsoft.com
WWW: http://www.infopager.com
> Does anyone know how to substitute the Edit control within a CListCtrl with
> a user defined version?
From the online docs (Tree Control Label Editing)
========================
During label editing, typically in response to the TVN_BEGINLABELEDIT
notification message, you can get a pointer to the edit control used for label
editing by using the GetEditControl member function. You can call the edit
control's SetLimitText member function to limit the amount of text a user can
enter or subclass the edit control to intercept and discard invalid
characters. Note, however, that the edit control is displayed only after
TVN_BEGINLABELEDIT is sent.
==================
In your OnBeginlabeledit you can use GetEditControl() to get a pointer to the
edit control which you can then use to subclass the control.
Jim [VC/MFC MVP]
To send mail, change nospam to msn