Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Help in converting to VB.NET

Reply
Thread Tools

Help in converting to VB.NET

 
 
=?Utf-8?B?UGF0cmljay5PLklnZQ==?=
Guest
Posts: n/a
 
      10-21-2004
Hi All,
Can anybody help in converting the code below to VB.NEt thanks.
I need the loop converted..
thanks

Private Sub expandCollapseAllTreeviewNodes(ByVal nodes As
TreeNodeCollection, ByVal expand As Boolean)
Dim node As TreeNode
'Loop through each node of the collection and expand it.
For Each node In nodes
if(expand)
{
node.Expanded = true;
expandCollapseAllTreeviewNodes(node.Nodes, expand)

}
else

{
node.Expanded = true;
expandCollapseAllTreeviewNodes(node.Nodes, expand)

}


Next

 
Reply With Quote
 
 
 
 
Karl
Guest
Posts: n/a
 
      10-22-2004
The code below is like 80% in VB.Net..and the FOR loop is converted.....

Private Sub expandCollapseAllTreeviewNodes(ByVal nodes As
TreeNodeCollection, ByVal expand As Boolean)
For Each node As TreeNode In nodes
If expand Then
node.Expanded = True
expandCollapseAllTreeviewNodes(node.Nodes, expand)
Else
node.Expanded = True
expandCollapseAllTreeviewNodes(node.Nodes, expand)
End If
Next
End Sub


Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/


"Patrick.O.Ige" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi All,
> Can anybody help in converting the code below to VB.NEt thanks.
> I need the loop converted..
> thanks
>
> Private Sub expandCollapseAllTreeviewNodes(ByVal nodes As
> TreeNodeCollection, ByVal expand As Boolean)
> Dim node As TreeNode
> 'Loop through each node of the collection and expand it.
> For Each node In nodes
> if(expand)
> {
> node.Expanded = true;
> expandCollapseAllTreeviewNodes(node.Nodes, expand)
>
> }
> else
>
> {
> node.Expanded = true;
> expandCollapseAllTreeviewNodes(node.Nodes, expand)
>
> }
>
>
> Next
>



 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      10-22-2004
Private Sub expandCollapseAllTreeviewNodes(ByVal nodes As
TreeNodeCollection, ByVal expand As Boolean)
Dim node As TreeNode
'Loop through each node of the collection and expand it.
For Each node In nodes
If expand Then
node.Expanded = true
expandCollapseAllTreeviewNodes(node.Nodes, expand)
Else
node.Expanded = true
expandCollapseAllTreeviewNodes(node.Nodes, expand)
End If
Next
End Sub


 
Reply With Quote
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      10-22-2004
The majority of what you have shown can be converted simply by removing the
semicolons. The IF needs a Then at the end of the line and you need to turn
the final } into an End If.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside the box!
*************************************************
"Patrick.O.Ige" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi All,
> Can anybody help in converting the code below to VB.NEt thanks.
> I need the loop converted..
> thanks
>
> Private Sub expandCollapseAllTreeviewNodes(ByVal nodes As
> TreeNodeCollection, ByVal expand As Boolean)
> Dim node As TreeNode
> 'Loop through each node of the collection and expand it.
> For Each node In nodes
> if(expand)
> {
> node.Expanded = true;
> expandCollapseAllTreeviewNodes(node.Nodes, expand)
>
> }
> else
>
> {
> node.Expanded = true;
> expandCollapseAllTreeviewNodes(node.Nodes, expand)
>
> }
>
>
> Next
>



 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      10-22-2004
For Each node As TreeNode In nodes....

Should be: For Each node In nodes

since "nodes" is already declared as TreeNodeCollection



"Karl" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net> wrote in
message news:%(E-Mail Removed)...
> The code below is like 80% in VB.Net..and the FOR loop is converted.....
>
> Private Sub expandCollapseAllTreeviewNodes(ByVal nodes As
> TreeNodeCollection, ByVal expand As Boolean)
> For Each node As TreeNode In nodes
> If expand Then
> node.Expanded = True
> expandCollapseAllTreeviewNodes(node.Nodes, expand)
> Else
> node.Expanded = True
> expandCollapseAllTreeviewNodes(node.Nodes, expand)
> End If
> Next
> End Sub
>
>
> Karl
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/
>
>
> "Patrick.O.Ige" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Hi All,
>> Can anybody help in converting the code below to VB.NEt thanks.
>> I need the loop converted..
>> thanks
>>
>> Private Sub expandCollapseAllTreeviewNodes(ByVal nodes As
>> TreeNodeCollection, ByVal expand As Boolean)
>> Dim node As TreeNode
>> 'Loop through each node of the collection and expand it.
>> For Each node In nodes
>> if(expand)
>> {
>> node.Expanded = true;
>> expandCollapseAllTreeviewNodes(node.Nodes, expand)
>>
>> }
>> else
>>
>> {
>> node.Expanded = true;
>> expandCollapseAllTreeviewNodes(node.Nodes, expand)
>>
>> }
>>
>>
>> Next
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help in converting to integer RishiRP@gmail.com VHDL 2 08-25-2005 04:29 PM
Urgent Help Needed Converting from XmlNode to Dataset =?Utf-8?B?TWFl?= ASP .Net 3 09-13-2004 02:28 AM
Help converting from ASP to ASP.NET and turning components on Wayfarer ASP .Net 1 07-31-2004 06:55 AM
Math problem - converting between arbitrary bases in perl - help! ! aaa Perl 1 05-28-2004 01:42 AM
ned help on converting C# to VB TJS ASP .Net 2 04-27-2004 09:14 PM



Advertisments