Tree-view styles govern aspects of a tree-view control's appearance. You set the initial styles when you create the tree-view control. You can retrieve and change the styles after creating the tree-view control by using the GetWindowLong and SetWindowLong functions.
The user can directly edit the labels of items in a tree-view control that has the TVS_EDITLABELS style. The user begins editing by clicking the label of the item that has the focus. An application begins editing by using the TVM_EDITLABEL message. The tree-view control notifies the parent window when editing begins and when it is canceled or completed. When editing is completed, the parent window is responsible for updating the item's label, if appropriate.
List View Window Styles
The following window styles are specific to list view controls.
Allows item text to be edited in place. The parent window must process the LVN_ENDLABELEDIT notification message.
The MMC_RESULT_VIEW_STYLE enumeration defines the Win32® list view style (LVS_*) flags that can be used to set the view style in the MMC result view pane. They can be used in the add and remove parameters of the IResultData::ModifyViewStyle method.
typedef enum _MMC_RESULT_VIEW_STYLE
MMC_SINGLESEL = 0x0001,
MMC_SHOWSELALWAYS = 0x0002,
MMC_NOSORTHEADER = 0x0003,
why #TVS_EDITLABEL succeeded and #LV/BS_EDITLABEL failed:
Code: Select all
If OpenWindow(0, 0, 0, 355, 180, "edit ListGadgetItem", #PB_Window_SystemMenu | #PB_Window_ScreenCentered) g0=TreeGadget(0, 10, 10, 160, 160) AddGadgetItem (0, -1, "Normal Item "+Str(a), 0, 0) AddGadgetItem (0, -1, "Node "+Str(a), 0, 0) AddGadgetItem(0, -1, "Sub-Item 1", 0, 1) AddGadgetItem(0, -1, "Sub-Item 2", 0, 1) AddGadgetItem(0, -1, "Sub-Item 3", 0, 1) AddGadgetItem(0, -1, "Sub-Item 4", 0, 1) AddGadgetItem(0, -1, "File "+Str(a), 0, 0) g1=ListViewGadget(1, 180, 10, 160, 160) For a = 0 To 6 AddGadgetItem(1, -1, ""+a) Next ;TODO,this ok: SetWindowLong_(g0, #GWL_STYLE,GetWindowLong_(g0, #GWL_STYLE) |#TVS_EDITLABELS) ;TODO,this no: SetWindowLong_(g1, #GWL_STYLE,GetWindowLong_(g1, #GWL_STYLE) |#LVS_EDITLABELS);LongPtr_(g1, #GWL_EXSTYLE ;TODO,other,what can this GadgetItem() do? : ; Returns the OS handle For the given item in a gadget. This is especially useful For use With the OS API. ; This function is currently only supported by TreeGadget() on Windows. It returns zero in other cases. id=GadgetItemID(0,2) Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow EndIf