Home > database >  Have to scroll to the node tree the scroll bar
Have to scroll to the node tree the scroll bar

Time:09-22

Pb 11.5 fixing the tree in the code, I found a handle, used selectitem has chosen the node, but of the tree no scroll bar to scroll to the node's page, need to manually drag the scroll bar to the node location,

PB6.5 will automatically scroll to page node is inside, don't know if you have encountered this problem?

If there are any functions or attributes can control the position of the scroll bar of the tree?

CodePudding user response:

I'm looking for? Did not find

CodePudding user response:

There should be no problem, give you a function that can be used to discover the node,
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
/in a treeview lookup matching label or data
/call syntax: findtreeitem (tv_tree fidnby, data)
/call parameters: the treeview tv_tree
Indicate the lookup/bollean findby methods: flase search label, true search data
/any data indicate the search content
/return value: long returns a handle to the item successfully handle
/0 found no
Error/- 1
/- 2 end find
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
Long ll_hdl []
Int li_level, li_data
Treeviewitem lt_tvi
String ls_label, ls_data
Dec ld_data

Gb_interrupt=false
Li_level=1
Ll_hdl [1]=tv_tree. Finditem (RootTreeItem! , 0)
The Do while li_level & gt; 0
//
The yield ()
If gb_interrupt then
Gb_interrupt=false
The exit
End the if

If tv_tree. The Getitem (ll_hdl [li_level], lt_tvi)=1 then return 1
If findby then
Choose a case the ClassName (lt_tvi. Data)
Case "integer"
Li_data=https://bbs.csdn.net/topics/integer (lt_tvi. Data)
Case "string"
Ls_data=https://bbs.csdn.net/topics/string (lt_tvi. Data)
Case "number"
Ld_data=https://bbs.csdn.net/topics/dec (lt_tvi. Data)
The end choose

If ls_data=https://bbs.csdn.net/topics/string (data) then
Return ll_hdl [li_level]
End the if
The else
Ls_label=lt_tvi. Label
If pos (ls_label, string (trim (data))) & gt; 0 then


Tv_tree. Selectitem (ll_hdl [li_level])
If MessageBox (' prompt ', 'whether or not to continue to find? 'the question! YesNo!)=2 then
The return - 2
End the if

End the if
End the if

If lt_tvi. Children then
Tv_tree. Expanditem (ll_hdl [li_level])
Li_level + +
Ll_hdl [li_level]=tv_tree. Finditem (ChildTreeItem! , ll_hdl [li_level - 1])
The else
Ll_hdl [li_level]=tv_tree. Finditem (NextTreeItem! , ll_hdl [li_level])
End the if
The do while ll_hdl [li_level] <=0
Li_level -
If li_level=0 then the exit
Tv_tree. Collapseitem (ll_hdl [li_level])
Ll_hdl [li_level]=tv_tree. Finditem (NextTreeItem! , ll_hdl [li_level])
Loop
Loop

Return 0




  • Related