How do you call a method inside that same method???


this code:

private sub expandalltreeviewitems(currenttreeviewitem treeviewitem)
if not currenttreeviewitem.isexpanded then
currenttreeviewitem.isexpanded = true
currenttreeviewitem.dispatcher.begininvoke(function() expandalltreeviewitems(currenttreeviewitem))
else
integer = 0 currenttreeviewitem.items.count - 1
dim child treeviewitem = directcast(currenttreeviewitem.itemcontainergenerator.containerfromindex(i), treeviewitem)
expandalltreeviewitems(child)
next
end if
end sub

this troubled line:

currenttreeviewitem.dispatcher.begininvoke(function() expandalltreeviewitems(currenttreeviewitem))

when try use throws error saying "expression not produce value"

can please tell me doing wrong.

thank you

hi,

you try use recursion.
recursion occurs when method calls itself. recursive functions need special stop conditions. otherwise infinitely continue calling themselves. byref keyword, provide way stop recursive function.

for more information recursion,please see links below:

http://www.dotnetperls.com/recursion-vbnet

http://msdn.microsoft.com/en-us/library/81tad23s.aspx

best regards,


we trying better understand customer views on social support experience, participation in interview project appreciated if have time. helping make community forums great place.
click here participate survey.






Silverlight  >  Programming Silverlight with .NET – General



Comments

Popular posts from this blog

Conditional formatting a graph vertical axis in SSRS 2012 charts

Register with Power BI failed

SQL server replication error Cannot find the dbo or user defined function........