Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
when i use TogglePattern.Toggle() method to select the treeItem,it will be selected,but a few seconds later,the treeItem state become not selected.how can i solve this question.can anybody give me an answer?
thanks!

TogglePattern togPattern = (TogglePattern)treeElementCollection[i].GetCurrentPattern(TogglePattern.Pattern);

if (togPattern.Current.ToggleState == ToggleState.Off)
{
togPattern.Toggle();
}
the code is here,as I just described.
Posted
Updated 25-Apr-13 4:18am
v3
Comments
Erik Rude 25-Apr-13 8:07am    
try posting some code. Maybe some one will be able to spot the issue.
Try limiting the amount of code to just what makes this behaviour happen.
Sergey Alexandrovich Kryukov 25-Apr-13 9:40am    
This is not what this pattern does (even if you can use it). And why changing the state by time? I don't see any sense in it...
—SA
xuyunhai 25-Apr-13 9:53am    
but just these code to select the treeItem.
you can download a tool named bus hound.and choose the "Device" page.
this page contains treeview component.
you can test to select the treeItem use my code.then you will find the problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900