Not exactly sure what you want to do but here are a few thing that can be usefull:
1, create callbacks: a piece of code that is executed when something changes in your tree component. In design view right clic on your tree, callback, add selection change function callback.
2. To know what node is selected:
You can access other properties of your tree the same way.
3. To disable some compenent: