473,382 Members | 1,615 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Windows style file browser

I've written a simple application which connects to an FTP server and
recursively lists the contents of the directories in this server in a
ListBox. What I'm wanting to do is change the ListBox and instead, use
something like the Windows file browser. Like when you go through My
Computer, that kind of thing.

Looking at the components that come with Windows.Forms I'm guessing my best
bet is the ListView. The problem I see with this component is, although you
can add pictures for the icons of the contents, they wont be the official
icons. I.E. When the user changes the icon theme these wont change because
they're static pictures.

Is it possible to use the official file browser in a C# app and if so how?
If not, what alternatives are there that I should look at?

Cheers,

Darrell

Nov 16 '05 #1
4 7672
Redneon,

You may be able to use the embedded Internet Explorer control (the browser
control contained within shdocvw.dll) and leverage its built-in file system
browsing capabilities to accomplish what you need.

Check out this article for a good tutorial on how to do this...

Let me know if it works....

Cheers,

Wadih Pazos

Solutions@MBA

wp****@satmba.com

www.SatMBA.com

www.PaperSave.com

"redneon" <re*****@discussions.microsoft.com> wrote in message
news:33**********************************@microsof t.com...
I've written a simple application which connects to an FTP server and
recursively lists the contents of the directories in this server in a
ListBox. What I'm wanting to do is change the ListBox and instead, use
something like the Windows file browser. Like when you go through My
Computer, that kind of thing.

Looking at the components that come with Windows.Forms I'm guessing my
best
bet is the ListView. The problem I see with this component is, although
you
can add pictures for the icons of the contents, they wont be the official
icons. I.E. When the user changes the icon theme these wont change because
they're static pictures.

Is it possible to use the official file browser in a C# app and if so how?
If not, what alternatives are there that I should look at?

Cheers,

Darrell

Nov 16 '05 #2
Darrell,

Even if you were able to access a file browser component, it would
probably link directly to the filesystem, and not allow you to specify which
items you want to display.

The ListView is still the way to go, IMO, you just have to get the icons
for the files. You can get the operating system icons. You can call the
SHGetFileInfo function through the P/Invoke layer to get the icon for
directories and files (either specific ones or for general ones). This way,
you don't have to worry about changes to the icons changing your icons.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"redneon" <re*****@discussions.microsoft.com> wrote in message
news:33**********************************@microsof t.com...
I've written a simple application which connects to an FTP server and
recursively lists the contents of the directories in this server in a
ListBox. What I'm wanting to do is change the ListBox and instead, use
something like the Windows file browser. Like when you go through My
Computer, that kind of thing.

Looking at the components that come with Windows.Forms I'm guessing my
best
bet is the ListView. The problem I see with this component is, although
you
can add pictures for the icons of the contents, they wont be the official
icons. I.E. When the user changes the icon theme these wont change because
they're static pictures.

Is it possible to use the official file browser in a C# app and if so how?
If not, what alternatives are there that I should look at?

Cheers,

Darrell

Nov 16 '05 #3
Thanks. I decided to go the SHGetFileInfo router because using IE wouldn't
allow me to specify what's shown. I'd have a lot more control, plus MS
recommend it. I've been looking at the followin MSDN article on it...

http://support.microsoft.com/?kbid=319350

....which has taught me what I needed to know. But I have a little problem
with it. It doesn't seem to work with transparencies well. Instead, it seems
to just show what should be transparent as black. Look at the following for a
screenshot...

http://www.attw91.dsl.pipex.com/capture.jpg

Any ideas of a way around this because it looks really ugly?

Darrell

Nov 16 '05 #4
Darrell,

I think that the reason that is happening is because you are using the
new icon formats that were introduced with XP. They have a larger color
palette, and I don't think that the ListView (or the painting algorithms)
support it as of yet. You will have to use the icons with the lower color
palette, I believe.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"redneon" <re*****@discussions.microsoft.com> wrote in message
news:27**********************************@microsof t.com...
Thanks. I decided to go the SHGetFileInfo router because using IE wouldn't
allow me to specify what's shown. I'd have a lot more control, plus MS
recommend it. I've been looking at the followin MSDN article on it...

http://support.microsoft.com/?kbid=319350

...which has taught me what I needed to know. But I have a little problem
with it. It doesn't seem to work with transparencies well. Instead, it
seems
to just show what should be transparent as black. Look at the following
for a
screenshot...

http://www.attw91.dsl.pipex.com/capture.jpg

Any ideas of a way around this because it looks really ugly?

Darrell

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Jeff T. | last post by:
All, Is there any way to access a separate IE 6.0 browser process via the Javascript DOM ? For example, open IE once. Open IE again (not using File->New). Can the second IE browser/process...
16
by: Robert Mark Bram | last post by:
Hi All! Is there a way to reference a window by name without doing something like this: open (, 'windowName'); The open method will open a blank window if there is no window with such a name....
6
by: Louise | last post by:
Hi I have written an HTML pages which does not have any colour specifying tags as far I know. When I view this in an Microsoft internet explorer browser it appears with a white background and...
4
by: Wintersrush | last post by:
I am working on a website that is using a Cascading Style Sheet. I've created the primary webpages and .css page. The format is the same throughout the entire website EXCEPT the color of the...
2
by: Joseph Geretz | last post by:
I'm having a credentialing problem in my web application. Actually, I don't think this is an IIS security issue, since I'm able to access the page I'm requesting. However, the executing page itself...
7
by: lvpaul | last post by:
Hallo ! I am using IIS-Windows-Authentication in my intranet (web.config <authentication mode="Windows" /> <identity impersonate="true" /> How can I get the users (client) IP-Address ? I...
3
by: Chris Paul | last post by:
I'm having trouble with PHP & PostgreSQL/OpenLDAP/Apache on Windows. I've set this up countless times on BSD (piece of cake) but I'm trying to do this on Windows now so that my developer can work...
5
by: Sean | last post by:
I have some themes with stylesheets, I have changed some of those style sheets and in fact have even completely removed some graphics completely from hard drive and yet if I use that class name the...
4
by: Duncan Jones | last post by:
I'm almost certain there is no easy answer to this question, but I'd thought I'd just check.... *Ignoring* for a second why I want to do this, is there any way to specify that an element in a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.