Information générale
Catégorie:
Gestionnaire d'écran & Écrans
>>>>>>How do i disable a treeview?
>>>>
>>>>>Is there something wrong with the .Enabled property? Works for me.
>>>>
>>>>I would expect that it would work for me too. But it doesn't. My treeview is still responding to the mouse click. I searched the whole UT for an awnser and found many members with the same problem. There was nobody who could solve the problem or couldn't even explain the reason.
>>>
>>>Which version of VFP and the TreeView are you using? VFP6/SP3 and TV6 work OK.
>>
>>
>>VFP6/SP3 and TV6 and IL6. I created a new form just to make sure that i'm using the newest versions. There is only the treeview, the imagelist and a button to disable the treeview. Same result. The treeview is responding to the mouseclick no matter wether it's enabled or not. I also tried all kinds of tricks i found in UT. It's really sad.
>
>Upon closer examination, what I found was that you have to use the OBJECTS Enable property:
>thisform.TreeView.Object.Enabled = .F.
>
>This will disbale clicking on the TreeView. You have to use the regular .Enabled property to stop being able to tab to the TreeView:
>thisform.TreeView.Enabled = .F.
>
>I hadn't realized I was using the object property, (buried inside a WITH/ENDWITH). You have to do both to stop total access to the TreeView. I wasn't aware about the tabbing not being stopped, so thanks for the "heads-up" on that one, wherever that came from.
Fred,
What I find interesting is the fact that I can subclass the treeview control,
and without any modifications...
ThisForm.Treeview.Enabled = .F. prevents tabbing to it as well disables
clicking on it.
Joe
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement