Click here to Skip to main content
15,891,777 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using CVSListBox and wants to make the items to be non editable.
Is it possible to make the items non editable in CVSListBox?
Also i want to add some functionality while changing the selection in the list of item present in the CVSListBox.How to achieve these requirement?
Is there any message like ON_LBN_SELCHANGE for CVSListBox ?

Thanks in advance.

What I have tried:

I tried with EnableWindow(FALSE) but it will make control non editable.
Posted
Updated 28-Sep-17 11:44am
Comments
Richard MacCutchan 20-May-16 3:44am    
Use an ordinary listbox instead.

1 solution

You may derive your own class from CVSListBox and override the virtual method
BOOL EditItem(int iItem){return FALSE;}
returning false.
Since the new and delete buttons may be useless in this situation
you may remove any of them by setting the desired flags in
SetStandardButtons(UINT uiBtns = AFX_VSLISTBOX_BTN_NEW | AFX_VSLISTBOX_BTN_DELETE | AFX_VSLISTBOX_BTN_UP | AFX_VSLISTBOX_BTN_DOWN).
As for your second question, you may use the LVN_ITEMCHANGED notification.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900