C++/VB - Expanding edit control

Asked By David Liebtag
13-Nov-09 02:33 PM
If you select a file name in the Windows shell and press F2 to rename the
file, you are put into an edit field whose width automatically increases as
you type more and more characters.

Does anyone know how they do that?  Is that a built in feature of edit
controls or have they subclassed it an added custom code to resize the
window?

Thanks a lot.

David Liebtag
GetTextExtentPoint32
(1)
Textmetrics.tmAveCharWidth
(1)
ListView
(1)
Everybody.David
(1)
Windows
(1)
RTL
(1)
  David Lowndes replied to David Liebtag
14-Nov-09 01:54 PM
David,

I am not aware of any inbuilt facility of the edit control that will do
that. Looking at message with Spy++ it would appear that the control
is just being resized, so I guess it is some custom code.

Dave
  Ivo Beltchev replied to David Lowndes
14-Nov-09 02:30 PM
Yeah, I think it is custom. But it is not that hard to do. Basically on
WM_COMMAND/EN_CHANGE measure the text (GetTextExtentPoint32), add some
padding, clamp with some minimal width (let us say
textmetrics.tmAveCharWidth*5). And finally clamp with the right edge of
the parent tree/list control so the control does not go out of the
parent's client area. Of course that is in reverse if you have RTL control.

Ivo
  Alain replied to David Liebtag
14-Nov-09 02:53 PM
See the ListView source code.
  David Liebtag replied to David Liebtag
15-Nov-09 09:08 AM
Thanks everybody.

David
help
VB6 - Sort Listview and select correct item C++ / VB Hi all, I am sorting a listview using the callback method. The listview sorts correctly, but if I loop through the sorted listview using listview1.ListItems(1).Text it returns the first listitem of the unsorted data. I read somewhere that I should use the API to get the current contents of the listview, but I cannot find the correct API or the correct usage. Any help would be appreciated. George VB Controls Discussions VB (1) Listview (1) WParam (1) CopyMemory (1) GetListItemFromlParam (1) CompareFunc (1) ListWindowProc (1) LColumn (1) Once you through WinXP SP2. And it works with both the VB5 and VB6 versions of the ListView. I can see this code NOT working under Vista, but I've never tested it ll still work or not. I would expect it to work with the VB6 version ListView under Vista, but maybe not the VB5 version (because the VB6 version isn't linked
Listview gridline freezing(merging) while using the vertical scrollbar C++ / VB I have created listview with gridlines and I have more lines in listview. before scrolling the data of listview using vertical scrollbar , the date is with in the gridline. When | scroll the data gridlines are merging with text. I tried by using subclassing the only listview cotrol but The line are flickering while scrolling. Please help guide me Win32 UI Discussions Vista (1) XP (1) Listview (1) Thnax (1) Scrollbar (1) Responce (1) Gridline (1) Ingrid (1) I think this is a known bug with the listview gridlines style. IIRC it is fixed in the Vista V6 common controls (which you only doing it yourself (I have never felt it worth the effort). Dave Thnax dave.:) keywords: Listview, gridline, freezing(merging), while, using, the, vertical, , , , scrollbar description: I have created listview with gridlines
Turn off EnsureVisble in Listview C++ / VB Hi, I wonder if anybody knows a way to turn off the ensure visible behaviour in a listview in icon view. I guess I must subclass the listview and looking for some listview messages, but in that case which listview message to trap? Rgds Ulrik VB WinAPI Discussions EnsureVisble (1) Listview (1) Rgds (1) Subclass (1) Icon (1) Don't multipost! keywords: Turn, off, EnsureVisble, in, Listview description: Hi, I wonder if anybody knows a way to turn off the ensure visible behaviour in a listview in icon view. I guess I must subclass the listview and looki