16,021,172 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 10377493 (Top 11 by date)
Member 10377493
3-May-14 4:27am
View
Thnaks alot it solved my problemnow i am able to view diffferent pictures but now it doesnot dim the background
Member 10377493
22-Mar-14 14:41pm
View
thats correct thanks alot..i have corrected the mistake.
One more thing i want is that when user checks an item in the listview and presses add cart button it adds amount at the back end how can i do that for one as well as multiple items
Member 10377493
16-Mar-14 12:51pm
View
This is my code
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
using System.Collections;
namespace Assignment1b
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
DriveInfo[] drives = DriveInfo.GetDrives();
for (int i = 0; i <= drives.Length - 1; i++)
{
comboBox1.Items.Add(drives[i].Name);
comboBox1.SelectedIndex = -1;
}
}
private void gobtn_Click(object sender, EventArgs e)
{
ShowTreeViewItems(pathtb.Text);
ShowDirectoryItems(pathtb.Text);
}
private void listView1_ItemActivate(object sender, EventArgs e)
{
comboBox1.Text = comboBox1.Text + listView1.SelectedItems[0].Text + "\\";
//ShowTreeViewItems(comboBox1.Text.ToString());
//ShowDirectoryItems(comboBox1.Text.ToString());
string length = comboBox1.Text + listView1.SelectedItems[0].Text + "\\";
if (!Directory.Exists(length))
{
System.Diagnostics.Process.Start(length);
}
else
{
stack.Push(comboBox1.Text);
comboBox1.Text = length;
ShowDirectoryItems(length);
}
}
private void ShowTreeViewItems(string Path)
{
try
{
DirectoryInfo CurrDir = new DirectoryInfo(Path);
DirectoryInfo[] SubDirs = CurrDir.GetDirectories();
FileInfo[] Files = CurrDir.GetFiles();
treeView1.Nodes.Clear();
TreeNode parentNode = new TreeNode();
parentNode.Text = Path;
parentNode.ForeColor = Color.Black;
parentNode.BackColor = Color.White;
parentNode.ImageIndex = 2;
parentNode.SelectedImageIndex = 2;
treeView1.Nodes.Add(parentNode);
foreach (DirectoryInfo dir in SubDirs)
{
TreeNode childNode = new TreeNode();
childNode.Text = dir.Name;
childNode.ForeColor = Color.Black;
childNode.BackColor = Color.White;
childNode.ImageIndex = 2;
childNode.SelectedImageIndex = 2;
parentNode.Nodes.Add(childNode);
}
foreach (FileInfo file in Files)
{
TreeNode childNode = new TreeNode();
childNode.Text = file.Name;
childNode.ForeColor = Color.Black;
childNode.BackColor = Color.White;
childNode.ImageIndex = 0;
childNode.SelectedImageIndex = 0;
parentNode.Nodes.Add(childNode);
}
ShowDirectoryItems(Path);
}
catch (Exception e)
{
MessageBox.Show(e.Message.ToString());
}
}
private void ShowDirectoryItems(string Path)
{
DirectoryInfo CurrDir = new DirectoryInfo(Path);
DirectoryInfo[] SubDirs = CurrDir.GetDirectories();
FileInfo[] Files = CurrDir.GetFiles();
DateTime dateModified;
listView1.Items.Clear();
listView1.BeginUpdate();
foreach (DirectoryInfo dir in SubDirs)
{
ListViewItem item = new ListViewItem();
item.Text = dir.Name;
item.ImageIndex = 1;
listView1.Items.Add(item);
}
foreach (FileInfo file in Files)
{
ListViewItem item = new ListViewItem()
Member 10377493
16-Mar-14 12:36pm
View
I am going crazy with it and today it has to be submitted kindly help !!! ;(((((
Member 10377493
16-Mar-14 12:36pm
View
I tried but its not working when i select any folder in tree view after this code it gives the following exception.
************* Exception Text **************
System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\Users\user\Documents\Visual Studio 2010\Projects\Assignment1b\Assignment1b\bin\Debug\libra'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileSystemEnumerableIterator`1.CommonInit()
at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 resultHandler, Boolean checkHost)
at System.IO.Directory.EnumerateFiles(String path, String searchPattern)
at Assignment1b.Form1.treeView1_AfterSelect(Object sender, TreeViewEventArgs e) in C:\Users\user\Documents\Visual Studio 2010\Projects\Assignment1b\Assignment1b\Form1.cs:line 161
at System.Windows.Forms.TreeView.OnAfterSelect(TreeViewEventArgs e)
at System.Windows.Forms.TreeView.TvnSelected(NMTREEVIEW* nmtv)
at System.Windows.Forms.TreeView.WmNotify(Message& m)
at System.Windows.Forms.TreeView.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18444 built by: FX451RTMGDR
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Assignment1b
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/user/Documents/Visual%20Studio%202010/Projects/Assignment1b/Assignment1b/bin/Debug/Assignment1b.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.18408 built by: FX451RTMGREL
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
<configuration>
<system.windows.forms jitdebugging="true">
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
Member 10377493
16-Mar-14 11:45am
View
how do i populate list view with any selected item in the tree view?
Member 10377493
16-Mar-14 10:06am
View
i just want to make a simple explorer that display the directories of drives contained in the drive.Can u help with that?
Member 10377493
16-Mar-14 9:49am
View
My form has a treeview a list view a combo box on top and a text box below a go button and a delete button...I want that when i select a drive the drive root node along with all the nodes gets displayed in the tree view as well as in list view i am trying to make an xplorer type app.how do i just get the directories in the tree view and all files and directories in list view
Member 10377493
14-Mar-14 17:08pm
View
thanks alot that worked for me :)
Member 10377493
14-Mar-14 15:46pm
View
yes thats right thnk you very much.Can you please guide me on this issue?
Member 10377493
14-Mar-14 15:21pm
View
can any body please answer this question of mine?
Show More