Knowledge Base

ShellBrowser .NET Edition

Geben Sie bittte einen Suchbegriff ein oder wählen Sie eine der obenstehenden Kategorien aus.

Alle Einträge (Seite 1 / 3)

Is there a WPF Edition Edition of ShellBrowser.NET components or are the ShellBrowser.NET components compatible with WPF?

Is there a WPF Edition Edition of ShellBrowser.NET components or are the ShellBrowser.NET components compatible with WPF?

A WPF edition of ShellBrowser.NET components is planned for 2016.

Currently, even though the ShellBrowser.NET components are based on Windows Forms, you can easily use them in your WPF application using the WindowsFormsHost class.

See here for a basic introduction:

You might also have a look at the provided example project "WPF and ShellBrowser.NET" that you can find in the "Examples" subfolder of your installation directory.


When I run my project from Visual Studio pdf, msg or sometimes txt files cannot be previewed in the ShellFilePreview component.

Depending on .NET Framework and Visual Studio version the Visual Studio hosting process might interfere with certain registered PreviewHandlers.

This behavior will not occur if Visual Studio is either not running or the hosting process is not enabled.

Try running your project with Visual Studio completely closed, or disable the hosting process in Visual Studio (In "Project\Properties\Debug" uncheck the option "Enable the Visual Studio hosting process".


I'm trying to preview .msg files with the ShellFilePreview component. This doesn't work or I can only see the header of the files.

Make sure that your application has visual styles enabled. You can do this by calling Application.EnabledVisualStyles() or by adjusting your application manifest.


What's the purpose of "JamDesign.dll"?

The file is necessary to develop software with the ShellBrowser controls but not to run them. "JamDesign.dll" must not be delivered together with the software that is using the ShellBrowser controls.

How can I prevent the selected path to be changed by the user?

Assign the PathChanged event for a ShellList and the BeforeSelect event for a ShellTreeView. If only want to allow the Windows folder, the code could look like this:

private const string cAllowedPath = "C:\\Windows";
private void shellListView1_PathChanged(object sender, EventArgs e)
 // Note: PathCollection also can check if the new Path is a subpath, by calling PathCollection.IsSubPathOf(string, string)
 if (!Jam.Shell.PathCollection.SamePath(shellListView1.Path, cAllowedPath))
  shellListView1.Path = cAllowedPath;

private void shellTreeView1_BeforeSelect(object sender, TreeViewCancelEventArgs e)
 if (!Jam.Shell.PathCollection.SamePath(((ShellTreeNode)e.Node)
.FullPath, cAllowedPath))
  e.Cancel = true;

The forward/backward buttons in the ShellHistoryToolStrip don't work. What's wrong?

Because the history functionality is contained in ShellControlConnector, you need to attach one to the ShellHistoryToolStrip Control by setting the property of the same name.

How can I prevent an item to be activated when the default activation action is executed in the ShellListView? I don't want the file to be opened, I only want to select the item.

Have a look at the JamExplorer example, here a MessageBox is shown to ask the user whether he really wants to open a file. The event is called BeforeInvokeCommandOnSelected.

Why is the use of the property ListViewItem.Caption discouraged?

Depending on the Windows Settings this property might not contain the complete file name but one with the extension cut off.
Instead, use the ShellListItem.FullPath property, it contains the full path to the file represented by the item.
The function Path.GetFileName(string path) gets you the full and pure file name and omits the path.

I'm setting the Path property of e.g. the ShellListView to a constant value like "C:\windows" when developing my application, is there a better way?

In general it is better to use only the SpecialFolder to explicitly set a path. The Path property is meant to be used to set the displayed path dynamically when the application is running on the system it is deployed on.
It can't be assumed that throughout different systems there's always an existing path "c:\" for example.

Clicking check boxes in a ShellFileList the first time is very slow. Is there any explanation for this behaviour?

For folders containing many files and subfolders the process of collecting file information (e.g. overall size) can take a while. If you'd like to suppress the scan, you can set the CalculateSelectedFiles property in the SelectionList to false.
This will suppress fetching the overall filesize, etc.

How can I access the files that where selected by the user via the Checkboxes functionality?

The ShellListView or ShellTreeView do not provide a property for this. Instead the ShellControlConnector component, that mediates the checkbox state between different controls in particular, has the property SelectionList which allows to iterate through the list of selected items.

The FullRowSelect does not work for the ShellTreeView, what's wrong?

Disable the ShowLines property to enable the full row selection. This needs to be done for all classes deriving from TreeView in order to get the expected result.