ListView problems: Displaying a button in a column 
Author Message
 ListView problems: Displaying a button in a column

hi everybody,
i had posted this problem earlier, but got no response.
i have subclassed a list control to behave like a grid, where inplace
editing can take place. when the focus moves to a particular column, i want
to display a button on that column, which the user can click on, and launch
a dialog. the button should disappearm when the focus moves to a different
column.
can somebody help.
thanks in advance.
-harish



Mon, 06 Mar 2000 03:00:00 GMT  
 ListView problems: Displaying a button in a column

Quote:

> hi everybody,
> i had posted this problem earlier, but got no response.
> i have subclassed a list control to behave like a grid, where inplace
> editing can take place. when the focus moves to a particular column, i want
> to display a button on that column, which the user can click on, and launch
> a dialog. the button should disappearm when the focus moves to a different
> column.
> can somebody help.
> thanks in advance.
> -harish

It looks like you have already done most of the work.

You can first check where the focus is by using HitTestEx given in
http://www.codeguru.com/listview/col_index.html place. Then, Create a
button and place it on top of ListCtrl.. If the hit is not on the
relevant column delete the control..
--
Girish Bharadwaj B.V.
Software Developer
http://members.tripod.com/~GBharadwaj/index.html




Tue, 07 Mar 2000 03:00:00 GMT  
 ListView problems: Displaying a button in a column



Quote:
> You can first check where the focus is by using HitTestEx given in
> http://www.codeguru.com/listview/col_index.html place. Then, Create a
> button and place it on top of ListCtrl.. If the hit is not on the
> relevant column delete the control..

i am sorry. i forgot to mention an important detail. my control is
ownerdrawn. so creating and deleting the control in OnDrawItem is a
problem. i have seen the code at codeguru.com and used it liberally in my
work too.
-harish
ps-> has somebody figured out the LVN_ITEMCHANGING problem.


Wed, 08 Mar 2000 03:00:00 GMT  
 ListView problems: Displaying a button in a column

Just a quick comment, whilst we're on the subject of list views:

I've had some troubles with the list view control.  Originally, all i
wanted was the equivalent of the standard list boxes 'GetCurSel()',
ie, a nice index between 0...n.  I haven't seen something equivalent.

I did the following, but I'm sure there must be a better way:

void CConfigureServers::OnChangedGroupList(NMHDR* pNMHDR, LRESULT*
pResult)
{
        NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR;

        // We Only update the group if we didn't set the item in the
        // SetGroup() function.  Otherwise it gets stuck in a horrid loop

        if((pNMListView->uChanged == LVIF_STATE) &&
                (pNMListView->uNewState & LVIS_SELECTED) &&
                (!m_bDontSelect))
        {
                SetGroup(pNMListView->iItem);
        };

        *pResult = 0;

Quote:
}

the 'm_bDontSelect' variable had to be called because of manually
selecting an item in the SetGroup() function which i think caused a
recursive loop :)  

Cheers,

Ben Ashley -  (Anti-Spam EMail Address.  Remove 'NOSPAM')

Programmer for Systems Integrated Research Plc
East Mill, Bridgefoot, Belper, Derbyshire



Fri, 10 Mar 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Listview problems:how do i display a button on the listcontrol

2. how to display image in listview column head?

3. Listview column problem

4. Listview column header problem

5. Listview column problem

6. ListView Problem!!(Right button popup menu)

7. Adding columns to ListView after it's been added to a form

8. How to hide/Disable a Column in ListView control C#

9. ListView Sorting by Column

10. how to draw on listview columns

11. Lock column width in ListView?

12. ListView columns and null strings - bug or docs?

 

 
Powered by phpBB® Forum Software