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
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.
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.
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.
Related
Ive been working on a C# project for a while now and I fell it needs change its look.
I have found a UI kit that I really like, which can be seen below:
http://medialoot.com/item/transparent-ui-kit/
Does anyone know how to do this?
Thanks
EDIT: Im using WinForms
EDIT2: Maybe I should convert over to WPF? Is this doable?
You can subclass most common controls and draw their appearance yourself. However, unless for novelty applications I doubt your users will thank you for doing so.
Your example is a library of controls. For you to have an appearance such as that you'll have to create or acquire a similar library of controls and replace all your controls in your project to get that appearance.
If you want to update colors (background, foreground, etc.) and such you can make a class that recurses through controls and sets the settings using reflection and a switch statement to process each control. Then just run this on each form before you show it. One word of caution about this, some controls don't respect your changes and get overridden with themes from the OS (datetimerpicker being the biggest culprit). You'll also need to consider whether your users will appreciate the extra work put in for color/appearance changes.
If you don't have very good design skill and have a good know how about creating such templates, its better to buy them.
And C# is just a language. You're looking to create templates and skins for either for ASP.NET website/application or for windows forms.
Have a look at DevExpress Skins
If you can afford it.
Is it a way to embed my User Control into Windows Explorer? Please tell me if you have any resources about this.
Thanks,
Weipeng
While you can, and there are a number of examples of how to do this. I recommend that you do NOT create shell extensions in managed code.
There are a number of reasons for this. For example, you now have to pull the entire managed runtime into the shell namespace. This means your explorer instance will use a lot more memory than is necessary.
However, the single biggest reason is that you cannot control which version of the namespace might already be in the shell process space when your control is loaded. See this article for why it's a bad idea.
I was wondering if anyone knows of an existing sample or an approach to achieve the desired functionality.
Basically, what I'm looking for is a web browser like skeleton. The idea is that the main screen of my application is shown in the left tab. This tab can never be closed. On this screen is an overview of various application components such as activities, events, contacts, etc.
When the user clicks on a specific contact/event/activity a new tab is created and auto-focused. The user can view and edit the information. When they are done they can close the tab.
The ability to have multiple tabs open is important.
Also, keyboard shortcuts to easily navigate between tabs would be great, but not absolutely essential at this point.
Note: I don't need to access any web content.
Really what I'm looking for, at least what I think I'm looking for, is a shell of a modern web browser. Does something like this exist? Is there a good approach to building such an application?
Note: I'm new to Windows GUI development, so I apologize if this is a rudimentary question. I was unable to find anything meaningful while searching MSDN and other resources.
Thanks!
What it sounds like is not really a Web Browser shell at all, simply the relative appearance of one functionality-wise.
What you can do is use a TabControl control. This can be altered to suit your needs quite perfectly in my view.
An example of a modified TabControl is as follows: [ From here ]
There are a number of things that can be done with a TabControl (as with any other component) to make it suit what you need.
Here are some links that you may find helpful:
Flat Tab Control - As per the picture
MSDN
Video on using a Tab Control
C# Corner
Using C# and WinForms in VS2008, I want to create a file browser control that looks and acts like the left pane in Windows Explorer. To my astonishment, such a control does not ship with .NET by default.
Ideally, I would like its contents to be exactly the same as in Explorer. For example, on Windows 7, it should show the Favorites and Libraries pseudo-folders. Of course, I do not want to code specifically for each version of Windows if I can help it.
I have browsed around, and there are some examples of such controls, but they are all hand-rolled and therefore won't work 100% the same as the one in Explorer.
Is there any way I can simply reuse the Explorer control instead? Or, if not, to get access to a tree of the items that it would show?
Microsoft provides a walkthrough for creating a Windows Explorer style interface in C#.
There are also several examples on Code Project and other sites. Immediate examples are Explorer Tree, My Explorer, File Browser and Advanced File Explorer but there are others. Explorer Tree seems to look the best from the brief glance I took.
I used the search term windows explorer tree view C# in Google to find these links.
It's not as easy as it seems to implement a control like that. Explorer works with shell items, not filesystem items (ex: the control panel, the printers folder, and so on). If you need to implement it i suggest to have a look at the Windows shell functions at http://msdn.microsoft.com/en-us/library/bb776426(VS.85).aspx.
Take a look at Shell MegaPack control set. It provides Windows Explorer like folder/file browsing with most of the features and functionality like context menus, renaming, drag-drop, icons, overlay icons, thumbnails, etc
I' trying to use webbrowser to create a folder explorer and I have few problems that I could not find any answer on the web... so I’ll appreciate your answers:
Can someone please explain how can I create the Up button (going to parent folder)?
How can I the explorer bar (on the left) to favorites or search as in windows explorer?
How can I implement the undo functionality (undelete files and folders)
What I would do intercept calls to a url and inject the data from your application. That way you can write HTML and display whatever functionality you want.
This Code Project WebBrowser Control might be useful too. I wouldn't be surprised if it allows you to handle the button click events on the navigation bar.