cancel
Showing results for 
Search instead for 
Did you mean: 

how to disable mouse click on checkbox for each treeviewitem?

Former Member
0 Kudos

treeview provode checkbox with state picture. When click on the pic, it will change the state pic.

I want to have this on display, but only for display, not allow user click on it to switch state pic. It means checkbox is read-only.

How to do it?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

You can do this :

-Create a function :

wf_set_checkbox_state (long al_tvihandle, long al_state) {

     treeviewitem ltvi

     tv_1.GetItem ( al_tvihandle, ltvi)

     ltvi.statepictureindex = al_state

     tv_1.SetItem ( al_tvihandle, ltvi )

}

-In the Clicked Event of the treeview add this code :

long  ll_state

treeviewitem ltvi

tv_1.GetItem ( handle, ltvi)

ll_state = ltvi.statepictureindex

post wf_set_checkbox_state (handle, ll_state)

Regards.

Abdallah.

Answers (1)

Answers (1)

arnd_schmidt
Active Contributor
0 Kudos

Do not forget to add some additional code in an event mapped to pbm_keydown:

if keyflags = 0 and key = KeySpacebar! then return 1

hth

Arnd

Former Member
0 Kudos

Right !

Abdallah.