Originally posted by: Dirso
Hi,
Is there anyway to use this with virtual lists?
Thank u very much,
Dirso.
Originally posted by: Andrew
void CMyListCtrl::OnLButtonDown(UINT nFlags, CPoint point)
int colnum;
to
void CMyListCtrl::OnLButtonDown(UINT nFlags, CPoint point)
int index=0;
I changed code from
{
int index;
CListCtrl::OnLButtonDown(nFlags, point);
if( ( index = HitTestEx( point, &colnum )) != -1 )
{
UINT flag = LVIS_FOCUSED;
if( (GetItemState( index, flag ) & flag) == flag && colnum > 0)
{
// Add check for LVS_EDITLABELS
if( GetWindowLong(m_hWnd, GWL_STYLE) & LVS_EDITLABELS )
EditSubLabel( index, colnum );
}
else
SetItemState( index, LVIS_SELECTED | LVIS_FOCUSED ,
����LVIS_SELECTED | LVIS_FOCUSED);�
}
}
{
// store click point
m_ClickPoint = point;
CListCtrl::OnLButtonDown(nFlags, point);
}
void CListCtrlEdit::OnDblclk(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
LV_DISPINFO *plvDispInfo = (LV_DISPINFO *)pNMHDR;
LV_ITEM*plvItem = &plvDispInfo->item;
int colnum=0;
if(( index = HitTestEx( m_ClickPoint, &colnum )) != -1 )
{
if( GetWindowLong(m_hWnd, GWL_STYLE) & LVS_EDITLABELS )
EditSubLabel( index, colnum );
}
else
SetItemState(index,LVIS_SELECTED|LVIS_FOCUSED,LVIS_SELECTED|LVIS_FOCUSED);
*pResult = 0;
}
and add protected member to CMyListCtrl
CPoint m_ClickPoint
Originally posted by: Lee
Hi,
The code works but in order for me to select a subitem i have to click on it twice. For example, say i have 3 cols and 3 rows. If I want to edit col 2 row 3, I click on it and col 1 row 3 is highlighted first, then if i click on it again the proper col is selected. Is there a way to make it select the right col on the first click?
A better description: You know in the default list control with edit labels enabled, when you click on the first column of this list the text is highlighted but not editable until you click on it again. My problem is that if you click on any other column the first column of that row is always highlighted first then when you click on the column again, you're able to edit it. This only happnes on the first click of that row.
ReplyOriginally posted by: Lee
Hi,
Anybody know how to fix that undeclared identifier problem? Thanks for your help.
ReplyOriginally posted by: Amit Deshpande
Thanks a lot. This is exactly what I was looking for. The detailed way you have explained and the clean way that u have done is simply fantastic.... It was very easy to implement. Thanks again
ReplyOriginally posted by: David Jenkins
I've created a new ComboBox that's very similar to the InPlaceEdit box and managed to add it to the listView, I can get it to display the list of text items I want the user to be able to select from, so that's fine.
But the only problem I've got is with the
DestroyWindow()
in my NewComboBox OnKillFocus() function.
Whenever it reaches that line it crashes.
The program runs fine until I double click the listView which I use to invoke an edit function on a sub item. As soon as I double click on the column that uses the NewComboBox it hits the DestroyWindow function in OnKillFocus.
I don't see why the OnKillFocus code is being invoked when I'm only creating it. :-/
I've a feeling it's being invoked before the actual component has been created.
Reply
Originally posted by: David
Exactly what I was looking for... perfect..
ReplyOriginally posted by: Mark Hilgart
I have a Win32 version of this example here:
http://www.markhilgart.com/code/subedit
Reply
Originally posted by: Brian
Hi,
Does anyone have a solution for allowing the user to mouse select a partial amount of the highlighted test after the InPlaceEdit box is created? It seems the listctrl gets the mouseover message instead of the edit control.
Brian
ReplyOriginally posted by: Udayini
I've used this for Pocket PC - WinCE application..
Thank You for this column
Udayini
Reply