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

  • Home
  • SEARCH
  • 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 9109759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:07:13+00:00 2026-06-17T03:07:13+00:00

i have a listview window browser thats working completely fine .i open folder through

  • 0

i have a listview window browser thats working completely fine .i open folder through folder browser and the files and folders in that particular directory opens in the listview via using

PopulateListView(path)

now in my mouse double click event im opening a particular file and folder it opens the file but when it opens the directory a new window pops up .i want that directory to b opened in the listview control…the code for this scenarioa is

private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            string pathdoubleClicked = listView1.FocusedItem.Tag.ToString();
          PopulateListView(pathdoubleClicked);

            Process.Start(pathdoubleClicked);
             simpleStack.Push(pathdoubleClicked);
        }

now i want to do it with if else like if the path is of drectory then go to populatelistview method other wise process.start but its now working any idea how can i do this

  • 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-06-17T03:07:14+00:00Added an answer on June 17, 2026 at 3:07 am

    From what I understand, if the path is a directory, you want to display its content on double-click. If it’s a file, you want to open it.

    So you would simply do:

    private void listView1_MouseDoubleClick(object sender, MouseEventArgs e)
    {
        string pathdoubleClicked = listView1.FocusedItem.Tag.ToString();
    
        if (System.IO.Directory.Exists(pathdoubleClicked))
        {
            PopulateListView(pathdoubleClicked);
        }
        else
        {
            Process.Start(pathdoubleClicked);
        }
    
        // ?
        simpleStack.Push(pathdoubleClicked);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a ListView on my WPF window, and I have a button that
I have a listview that includes links to open an iframe with jQuery and
I have a window form application, and in that I have a ListView called
I have WPF window containing a listview that has it's itemsource set to a
I have an activity with ListView that has: android:theme=@android:style/Theme.Dialog in Manifest. When I open
I have a ListView that allows the user to change the ViewBase through a
I have a ListView in a WPF window containing a number of GridViewColumns. The
I have Process objects that are monitored from two different views. A Windows.Forms.ListView (actually
I have a window that uses a viewmodel. This screen contains 2 listviews on
I have ListView that has the following EditItemTemplate: <EditItemTemplate> <tr style=> <td> <asp:LinkButton ID=UpdateButton

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.