Programmatically edit a treeview label: Difference between revisions

From DataFlex Wiki
Jump to navigationJump to search
m
Added to Tutorials category
m (Added to Tutorials category)
 
(4 intermediate revisions by 3 users not shown)
Line 9: Line 9:
First you have to enable label editing with:
First you have to enable label editing with:


<source lang="vdf">
  Set TreeEditLabelsState to True
  Set TreeEditLabelsState to True
</source>
Then you have to send TVM_EDITLABEL for example as in:


Then you have to send WM_EDITLABEL for example as in:
<source lang="vdf">
 
  Procedure EditNow
  Procedure EditNow
     Handle hItem
     Handle hItem
Line 24: Line 26:


  On_Key Key_Alt+Key_F1 Send EditNow
  On_Key Key_Alt+Key_F1 Send EditNow
</source>


As you can see I've not tested with doing it just after adding the item but  
As you can see I've not tested with doing it just after adding the item but  
Line 39: Line 42:
Correct syntax would be
Correct syntax would be


<source lang="vdf">
   Procedure AddAndEditItem
   Procedure AddAndEditItem
     Handle hItem
     Handle hItem
Line 51: Line 55:
     End
     End
   End_Procedure
   End_Procedure
</source>


Depending on the version of VDF you are using you have the following events and  
Depending on the version of VDF you are using you have the following events and  
properties
properties
<source lang="vdf">
  pbCancelEdit
  pbCancelEdit
  OnBeginLabelEdit
  OnBeginLabelEdit
  OnEndLabelEdit
  OnEndLabelEdit
</source>


These are documented in the Help system
These are documented in the Help system
Line 66: Line 73:


[http://msdn.microsoft.com/en-us/library/bb773562(VS.85).aspx MSDN TVM_EDITLABEL Message]
[http://msdn.microsoft.com/en-us/library/bb773562(VS.85).aspx MSDN TVM_EDITLABEL Message]
[[Category:How To]]
[[Category:Tutorials]]

Navigation menu