Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6750937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:52:03+00:00 2026-05-26T12:52:03+00:00

I have translated some code from C# to VB.net for the purpose of getting

  • 0

I have translated some code from C# to VB.net for the purpose of getting Folder Browser functionality. The link to the code is here…..

http://www.codeproject.com/KB/aspnet/DirectoryBrowsing.aspx

My issue is that I have not been able to correcly translate these two lines of code to VB.net.

TreeView1.TreeNodeExpanded +=new TreeNodeEventHandler(TreeView1_TreeNodeExpanded);
TreeView1.SelectedNodeChanged += new EventHandler(TreeView1_SelectedNodeChanged);

Every translator I have used has simply dropped the semicolon from the end of each line. But the editor still does not like them.

I could some help with this as it seems this effects the refresh of the selected folder in the tree view control.

enter image description here

I don’t get to see the C drive folder unless I type the path in the text box, and the folder will still not expand.

thank you,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:52:03+00:00Added an answer on May 26, 2026 at 12:52 pm

    Use this:

    AddHandler TreeView1.TreeNodeExpanded, AddressOf TreeView1_TreeNodeExpanded
    AddHandler TreeView1.SelectedNodeChanged, AddressOf TreeView1_SelectedNodeChanged
    

    Edit:

    A different way to do this would be to apply it at the method level:

    Protected Sub TreeView1_TreeNodeExpanded(ByVal sender as Object, ByVal e as TreeNodeEventArgs) Handles TreeView1.TreeNodeExpanded
    
        ' Some code
    
    End Sub
    
    Protected Sub TreeView1_SelectedNodeChanged(ByVal sender as Object, ByVal e as EventArgs) Handles TreeView1.SelectedNodeChanged
    
        ' Some code
    
    End Sub
    

    You should run this in debug to find out what exactly is going on. I find a lot of times when events of this nature are run in asp.net, you have a conflicting event that “resets” the controls you are attempting to change.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a .net-website project and want to get some file from app_data folder.
I have a code that need to be translated from C to Cpp, and
I've got some code originating from a DSL that needs to be translated for
I have some jquery code which I am trying to translate to YUI. I
I have translated Jeremiah Clark's CheckBoxList Helper for MVC into my VB.Net project but
I have translated a document from English to Norwegian in the LaTeX format, and
I am currently translating a program from QBasic to VB.Net and I have this
I'm using some code to extract from a Google Url the keyword of the
Hey folks, I have the following piece of code from C++. for (int i=0;
i have to transform some query i´m using in SQL to Oracle code. I´m

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.