 |
|
 |
Dear Carlos Souza,
Are you around ? I am waiting for your answer..
Could you please answer how to select multiple items in your Listcontrol and then delete the selected items.
regards
Dinakara K
CAIR, Bangalore
|
|
|
|
 |
|
 |
Dear Carlos Souza
Wish you a very happy and successful new Year...
With regard to Expandable List Control, How to do multiple selections and delete the selected Items.
Because each row can have different height.
regards
Dinakara K
Dinakara K
CAIR, Bangalore
|
|
|
|
 |
|
 |
Dear Carlos Souza,
How to Delete the selected Item(s)in this Multiline ListBox
Thanks
Dinakara K
Dinakara K
CAIR, Bangalore
|
|
|
|
 |
|
 |
Oh, it no meet my intentions,my friend. I wanted to find a way to let the row in CListCtrl has different height, and I thought your code would guide me, the first sight I saw CMultiLineListCtrl. But just now, I found the way you used to change row's height is a little helpless for me.
Anyway, thinks a lot.
|
|
|
|
 |
|
 |
I think there is something very helpful for me, for which I will write my list control conveniently.
Thinks a lot.
|
|
|
|
 |
|
 |
how to set SetExtendedStyle for checkbox LVS_EX_CHECKBOXES
i've added
m_list_multi.SetExtendedStyle(LVS_EX_FULLROWSELECT |LVS_EX_CHECKBOXES);
but it's not works..
i am using vs2007
|
|
|
|
 |
|
 |
How to expand all items ? an OpenAll() would be nice
|
|
|
|
 |
|
 |
Quick and Dirty but Working fine for me ...
void CMultiLineListCtrl::ExpandAll()
{
for ( int nRow = 0; nRow == nRow; nRow++)
{
if ((int) GetItemData( nRow)>=1 && (nRow==GetItemCount()-1 || (int)GetItemData(nRow+1)>=1))
OpenCloseRow( nRow);
if ( nRow == GetItemCount() -1)
break;
}
}
void CMultiLineListCtrl::ContractAll()
{
for ( int nRow = 0; nRow == nRow; nRow++)
{
if ((int) GetItemData( nRow)>=1 && (nRow==GetItemCount()-1 || (int)GetItemData(nRow+1)>=1))
;
else
OpenCloseRow( nRow);
if ( nRow == GetItemCount() -1)
break;
}
}
Thierry
|
|
|
|
 |
|
 |
Suppose a cell is open and has two lines "Hello\r\nThere"
If you SetItemText(0,2,"Hello Sir\r\nThere") the cell will be updated.
But if you SetItemText(0,2,"Hello\r\nHere") the cell is NOT updated
until you close it and open it again.
In other words, how to change the 2nd 3rd etc line of a cell,
so that it updates on the screen?
Thanks very much.
|
|
|
|
 |
|
 |
Hi billgatest
This class really doesn't refresh datas. Only the protected function OpenCloseRow(int row) update them.
A solution will be create the public function below. It doesn't solve the problem, but automate the process .
void CMultiLineListCtrl::RefreshRow(int row) {
OpenCloseRow(row);
OpenCloseRow(row);
}
|
|
|
|
 |
|
 |
Thanks very much for the help, your solution works 100% for me.
|
|
|
|
 |
|
|
 |
|
 |
I did notice that, while using the double-click to expand/collapse interaction, that once expanded, a collapse would only occur if the mouse event occurred within the vertical distance occupied by a single row. Double-clicking near the bottom edge of an expanded row was ignored (no collapse occurs).
|
|
|
|
 |
|
 |
Hi c-sharp
To collapse double-clicking in any line, add the code below in beginning of OpenCloseRow(int) function:
for (;(int)GetItemData(row)<1;row--);
SetItemState(row, LVIS_SELECTED, LVIS_SELECTED | LVIS_FOCUSED);
EnsureVisible(row, FALSE);
|
|
|
|
 |
|
 |
so do I,tkx very much.
|
|
|
|
 |
|
 |
I really liked this idea (5).
Some issues I came across:
1. Under the XP silver theme the expansion boxes are not visible.
2. I had to double click to get the items to expand when I expected to be able to just single-click the expansion button
|
|
|
|
 |
|
 |
Hi .dan.g
This functions can help you change the boxes color [SetBoxColor(color)] and expand with single-click [OnClick(...)]:
MultiLineListCtrl.h
public:
void SetBoxColor(COLORREF color);
afx_msg void OnClick(NMHDR* pNMHDR, LRESULT* pResult);
MultiLineListCtrl.cpp
BEGIN_MESSAGE_MAP(CMultiLineListCtrl, CListCtrl)
ON_NOTIFY_REFLECT(NM_CLICK, OnClick)
...
END_MESSAGE_MAP()
void CMultiLineListCtrl::SetBoxColor(COLORREF color)
{
colorSymbol = color;
dot.DeleteObject();
LOGBRUSH LogBrush;
LogBrush.lbColor = colorSymbol;
LogBrush.lbStyle = PS_SOLID;
dot.CreatePen( PS_COSMETIC | PS_ALTERNATE , 1, &LogBrush, 0, NULL );
}
void CMultiLineListCtrl::OnClick(NMHDR* pNMHDR, LRESULT* pResult)
{
DWORD pos = GetMessagePos();
CPoint pt(LOWORD(pos), HIWORD(pos));
ScreenToClient(&pt);
int cell = HitTest(pt);
if (cell>-1 && GetItemData(cell)!=1)
OpenCloseRow(cell);
*pResult = 0;
}
|
|
|
|
 |