Problem selcting active child form but Treeview tab not changing.

Troy

Well-known member
Joined
Feb 7, 2005
Messages
153
Programming Experience
10+
Hey all. I didn't know where to post this for sure since it relates to displaying a windows form or the treeview control.

My Main MDI Parent form displays a treeview control on the left side of my screen, populated with the names of customers.

on the right is the area where once they select a customer the child form containing their information is displayed.

ok problems so far.

1. I only need to trigger displaying a child form once per customer. I've almost fixed this one (think I can get it)

2. When I select the child window from the Treeview everything works fine, My treeview node pertaining to the selected child is correct.
But if I select the child by clicking the child form my treeview doesn't update to the correct customer being displayed.

How can I update the selected treeview node without actually displaying another childform.

I've tried Treeview.Select but it reruns my Treeview_afterselect code and redisplays another child form for the same customer.

Any ideas?
 
I don't know if this will help, but when I need to do something to a control and not have any of the events fire I call RemoveHandler, do what I need to do, and call AddHandler to turn it back on. May not be the best solution, but it works great so far.

Example:
VB.NET:
RemoveHandler TreeviewCtrlName.AfterSelect, AddressOf TreeviewCtrlName_AfterSelect
'do stuff here
AddHandler TreeviewCtrlName.AfterSelect, AddressOf TreeviewCtrlName_AfterSelect
 
Last edited by a moderator:
Sweet didn't know you could do that ...Mwhahahahaha!

Thanks Frosty!
 
Back
Top