views:

837

answers:

3

Hi,

I'm trying to create an easy money folder explorer in c# and, because I'm a noob, I don't have many ideas except using webbrowser, which works (if anyone has a better idea please let me know it).

THE QUESTION: how do I make it start in "view - medium icons" instead of "view - details" ?

Thanks a lot, Ionut

+2  A: 

You might be taking the wrong approach here - have you considered using an ordinary ListView control? You'll have much more control over how your icons, columns, etc., are shown.

MSDN even has a tutorial showing how to use a ListView to mimic Explorer functionality.

Charlie Salts
A: 

Hello,

you have to use P/Invoke to achieve this. In summary, WebBrowser uses a windows control SysListView to display the files. This control can be accessed and customized via P/Invoke.

For an example of how to do this, go here --> WebBrowser to view local files.

najmeddine
Thanks for your answer, it sort of works, but not really: it switches the view from details to small icons BUT the table header with all the columns are still there, which makes the width large. Any idea how to get rid of this table header? I'm testing on windows 7.The really killer part is that if I try to open a folder, it opens it in a new windows explorer window outside my frame, making me cry. How can I make it open the folder on the spot?Many thanks for your time.
Ionut
A: 

The WebBrowser is very inflexible and slow for browsing files and folders. Consider using controls such as FileView developed spcifically for file and folder browsing.

logicnp