Tech
Forums
Jobs
Books
Events
Live
Interviews
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
7
Reply
mouse double click in listview?
Serhan Srhn
Dec 3 2014 8:11 AM
1.4k
Reply
I have a listview and want to show folders in C drive in listview. but when I clicked double to listview, it doesn't show folders in folder, for example; folders in program files. I wonder how can I list folders in C drive by mouse duble clicking?
private void lstw_MouseDoubleClick(object sender, MouseEventArgs e)
{
for (int i = 0; i < lstw.Items.Count; i++)
{
if (lstw.Items[i].Selected == true)
{
string path = lstw.Items[i].Name;
lstw.Items.Clear();
listFill(path);
}
}
}
private void listFill(string pth)
{
DirectoryInfo dInfo = new DirectoryInfo(pth);
try
{
foreach (DirectoryInfo di in dInfo.GetDirectories())
{
lstw.Items.Add(di.Name,di.FullName);
}
}
catch { }
}
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
7
)
Next Recommended Forum
Get Google Calendar Events
Whether it is possible