I am building a form with a Treeview control whose nodes represent folders
for reports. Navigating in the tree updates the listbox lstReports as the
nodes are selected by clicking the mouse. This works fine, but I prefer to
keep my hands on the keyboard. The cursor keys and alpha keys work to move
about in the Treeview control, but the rowsource property of my listbox
doesn't update until the user clicks with the mouse. Is there another event
or method I can use besides _click(), to update the property as the user
navigates through the control?
This code is simple, but you can see that clicking in the treeview populates
reports in another control, and updates the enabled property of the "Remove
Node" button, making it True if the node is childless.
---------------------------------------
Private Sub xTV_Click()
lstReports.RowSource = _
"SELECT ReportID, Name, ToDate " & _
"FROM Reports " & _
"WHERE Parent = '" & xTV.SelectedItem.Key & "' " & _
"ORDER BY todate, Name ;"
cmdRemoveNode.Enabled = xTV.SelectedItem.Children = 0
End Sub
---------------------------------------
Thanks in advance.
Paul Johnson
Alex Dybenko - 08 Apr 2004 07:16 GMT
Poul
you better use Node Click event

Signature
Alex Dybenko (MVP)
http://Alex.Dybenko.com
http://www.PointLtd.com
> I am building a form with a Treeview control whose nodes represent folders
> for reports. Navigating in the tree updates the listbox lstReports as the
[quoted text clipped - 24 lines]
>
> Paul Johnson