Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Basic C# question
Message
From
05/07/2006 21:42:01
 
 
To
05/07/2006 18:19:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 2.0
Miscellaneous
Thread ID:
01133939
Message ID:
01134015
Views:
24
>Maybe:
>
>for (int i = 0,nCount = this.TreeView1.Nodes.Count; i < nCount; i++)
>{
>// however question is: operation might depend on realtime
>// nodes count? or a reverse iteration, count to 0?
>// maybe you'd want to use a foreach() instead which uses an enumerator?
>
>// foreach(TreeNode node in myTree.Nodes)
>}
>
Unlike VFP's for, condition is a boolean and it is a version of while{} (and by language definition conditon is reevaluated each time). ie:
>
>for(int i=0,j=5;i<j;i++)
{
 Console.WriteLine("i:{0} j:{1}",i,j);
 j--;
}
PS: Also it matters which Treeview control is this. Web or Windows.
>Cetin


Interesting idea. Let me ponder it a while and try it tomorrow at work. It is a web (ASP.NET 2.0) TreeView.


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform