Home of Shell MegaPack : Windows Explorer-Like File & Folder Browser Controls & Components For .Net & ActiveX

FolderView.Net Control How-To Guide

Categories

Search for a topic in the following categories..

Installation
Deployment and distribution
Licensing and registration
Usage in web development
Customization ( custom icons, custom displaytexts, custom nodes, etc..)
Behavior control ( e.g. prevent opening of files)
Filtering ( e.g. show only files)
General - programmatic control

*In this guide, the terms folder, file, TreeNode and node are used interchangeably.
*The sample application which demonstrates each topic is indicated in brackets.


Installation

No topics in this category


Deployment and distribution

What are the procedures for distributing FolderView.Net Control with my application?

To deploy your application which uses FolderView.Net Control, include only the SkySoftware.FolderView.dll assembly file with your installation program. FolderView does not have any dependencies, so SkySoftware.FolderView.dll is the only file that needs to be redistributed with your application. If you have developed your application using Visual Studio.Net 2002, this file must be installed to the Global Assembly Cache (GAC) on the end-user's machine for the control to work. If you are using Visual Studio.Net 2003, you can simply copy the file to the same directory as your executable file.

IMPORTANT : You are not permitted to make available to end-users the license information which LogicNP Software sends you when you purchase a license. Read the FolderView.Net Control legal agreement for complete information.


Licensing and registration

How can I enter license information in the FolderView.Net Control after I have purchased a license?

After you have purchased the FolderView.Net Control, LogicNP Software will send you licensing information and the procedure to properly license the control. To enter the license information, follow these steps..

  • Right-click on the control in design-mode, i.e. when the control is on the form-designer and then select 'Activate License..'.
  • Enter the license information exactly as you received it from LogicNP Software.

After the above steps are performed, there are still a few more steps that must be done before the control can use the registration information correctly and stop showing the About box. These steps are different for different development environments as described below :

  • Microsoft Visual C++.Net : Close and reopen the dialog resource on which the control is being used and change the position of the control ( and then hit undo if the position change is unwanted)
  • Microsoft Visual Basic.Net and Microsoft Visual C#.Net : Delete and reinsert the control on the form(and give the reinserted control the original name, so that your code continues to work).

I entered the license information but the Product Information dialog box still pops up from time to time. What should I do?

When you enter the license information as per the steps mentioned in the above topic, it is stored in the registry. When the project exe or dll file is being built, the control retrieves this information from the registry and embeds it in an encrypted form in the project exe or dll file. At runtime, the control uses this information to determine if it is licensed properly.

However, on some occasions, the license information embedded in the project exe or dll file might not get refreshed after the control license status changes ( no license information => valid license information in the registry ). You can determine if valid license information is embedded in the project exe or dll file, by running the project in Debug mode and examining the contents of the Output Window. If valid information is embedded, then the Output Window should contain a line which reads "FolderView Licensed = True". If valid information is not present, the line will read "FolderView Licensed = False"

If valid information is not embedded, the following steps should be performed :

  • Do a 'Rebuild All' on your project. Often this does a fresh build of your exe or dll file and valid license information will get embedded in it.
  • If valid information is still not embedded, from the licenses.licx file found in your project directory, remove the line corresponding to the FolderView.Net control.
    The line should be similar to the following line :
    SkySoftware.FolderViewControl.FolderView, SkySoftware.FolderView, Version=5.2.0.0, Culture=neutral, PublicKeyToken=d645dd87b2631575
    After this again do a 'Rebuild All' on your project.
  • If valid information is still not embedded, remove the reference to the SkySoftware.FolderView assembly from your project. Then reinsert the reference to the SkySoftware.FolderView assembly and do a 'Rebuild All' on your project. This should refresh the licenses.licx file with the line corresponding to the FolderView.Net control.
  • If valid information is still not embedded in the project exe or dll file, manually reinsert the removed line in the licenses.licx file and do a 'Rebuild All' on your project.

Are there separate licensed and unlicensed versions of the control? If not, then how do I know if the control is properly licensed and whether it will work in the licensed mode ( no Product Information dialog) on the end-users' machine?

There are no separate licensed and unlicensed versions of the control. When you enter the license information as per the steps mentioned in the above topic, it is stored in the registry. When the project exe or dll file is being built, the control retrieves this information from the registry and embeds it in an encrypted form in the project exe or dll file. At runtime, the control uses this information to determine if it is licensed properly. There is no need to distribute the sensitive license information to end-users. In fact, this is prohibited.
IMPORTANT : You are not permitted to make available to end-users the license information which LogicNP Software sends you when you purchase a license. Read the FolderView.Net Control legal agreement for complete information.

You can determine if valid license information is embedded in the project exe or dll file, by running the project in Debug mode and examining the contents of the Output Window. If valid information is embedded, then the Output Window should contain a line which reads "FolderView Licensed = True". If valid information is not present, the line will read "FolderView Licensed = False"


Usage in web development

No topics in this category


Customization ( custom icons, displaytexts, items, etc..)

How can I display my own icons and texts to files/folders shown in FolderView.Net Control?
(Demonstrated in sample application : Customization)

You can display your own text or icons for files/folders shown in FolderView.

To change the text shown for a TreeNode, you should use the Text property. You can change this property for each node in the NodeAdd event which is called after each node is added.


How can I change the font and colors used by FolderView.Net Control?
(Demonstrated in sample application : n/a)

You can use the Font, BackColor and ForeColor properties to do so. You can change these properties at design time through the property-pages of the control.


How can I customize the underlying treeview control?
(Demonstrated in sample application : StarterSample)

You should use the BorderStyle, HasButtons, HasLines, HasLinesAtRoot, HotTracking, Indent properties.


How can I set the root folder of FolderView.Net Control to something other than the 'Desktop'?
(Demonstrated in sample application : StarterSample)

To set a root folder to something other than the Desktop, you should use the RootFolder or the RootPidl properties.

The RootFolder property only accepts filesystem folders. To set a non-filesystem folder such as the 'Control Panel' as the root, you should use the RootPidl property.


How can I display overlay icons for non-shortcut or non-network folders/files?
(Demonstrated in sample application : n/a)

You should use the OverlayIconIndex property of TreeNode.


How can I programmatically set a node as the root of the FolderView.Net Control?
(Demonstrated in sample application : NodeInformation)

You should use the SetAsRoot method of TreeNode.


How can I show checkboxes for each node in FolderView.Net Control?
(Demonstrated in sample application : StarterSample)

You should set the ShowCheckBoxes property to True.


How can show/hide the check box for individual nodes?
(Demonstrated in sample application : Customization)

You should set the ShowCheckBox property of TreeNode to True/False to show/hide the check box respectively.


How can I add custom contextmenu items in the contextmenu shown when a file/folder is right-clicked?
(Demonstrated in sample application : Customization)

You should use the ItemRightClick event to add user-defined context menuitems. Then respond to the selection of the custom contextmenu item in the CustomContextMenuItemSelect event.


How can I add custom items in FolderView?
(Demonstrated in sample application : Customization)

You should use the AddCustomNode to add custom items



Behavior control ( e.g. prevent opening of files)

How can I automatically check/uncheck all children when a parent node is checked/unchecked?
(Demonstrated in sample application : n/a)

Just set the AutoCheckChildren property to True.


How can I disable the default behavior of FolderView.Net Control to keystrokes like 'Del' and 'Ctrl-C', etc.?
(Demonstrated in sample application : StarterSample)

Just set the DefaultKeyHandling property to False.


How can I prevent a node from being checked/unchecked?
(Demonstrated in sample application : BehaviorControl)

You should set the Cancel parameter to True in the NodeChecked event.


How can I prevent a node from being expanded/collapsed?
(Demonstrated in sample application : BehaviorControl)

You should set the Cancel parameter to True in the NodeExpanding and NodeCollapsing events respectively.


How can I prevent context menus from appearing when a folder/file is right-clicked?
(Demonstrated in sample application : BehaviorControl)

You should set the ShowContextMenus property to False.


How can I show files in FolderView.Net Control?
(Demonstrated in sample application : StarterSample)

You should set the ShowFiles property to True.


How can I prevent showing of contextmenu for certain items?
(Demonstrated in sample application : BehaviorControl)

You should set the CancelEvent property to True in the NodeRightClick event.


How can I prevent certain shell commands (like Delete) from being executed on certain items?
(Demonstrated in sample application : BehaviorControl)

You should set the Cancel parameter to True in the BeforeShellCommandExecute event.


How can I prevent the display of or change the default infotips shown for folders?

You should use the GetInfoTip event.


How can I prevent a dragdrop operation from starting on a per-node basis or prevent a drop action on a per-node basis or change the default drop action (e.g. from copy to move)?

You should use the FolderViewStartDrag, FolderViewDragDrop and FolderViewDragOver events.

 



Filtering ( e.g. show only files)

How can I prevent non-filesystem folders/files or hidden folders/files from displaying?
(Demonstrated in sample application : StarterSample)

You should set the ShowHiddenObjects and ShowSpecailFolders properties to False.


How can I prevent a certain node from displaying in FolderView.Net Control?
(Demonstrated in sample application : n/a)

You should use the Delete method of TreeNode. A good place to call this method is in the NodeAdd event.



General

How can I enumerate all the folders/files shown in FolderView.Net Control?
(Demonstrated in sample application : n/a)

To enumerate through all the nodes, you should use the GetFirstItem and GetNextItem properties.


How can I programmatically select a specific node in FolderView.Net Control?
(Demonstrated in sample application : n/a)

You should use the SelectNode property.


How can I determine if a node is a custom node?
(Demonstrated in sample application : NodeInformation)

You should use the IsCustom property of TreeNode.


How can I determine if a node is the desktop node?
(Demonstrated in sample application : NodeInformation)

You should use the IsDesktop property of TreeNode.


How can I determine if a node is a file or a folder?
(Demonstrated in sample application : NodeInformation)

You should use the Attributes property of TreeNode.


How can I determine if a node belongs to the filesystem?
(Demonstrated in sample application : NodeInformation)

You should use the Attributes property of TreeNode.


How can I determine if a node is a shortcut?
(Demonstrated in sample application : NodeInformation)

You should use the Attributes property of TreeNode.


How can I determine if a node is readonly or hidden?
(Demonstrated in sample application : NodeInformation)

You should use the Attributes property of TreeNode.


How can I programmatically check/uncheck a node?
(Demonstrated in sample application : NodeInformation)

You should use the Checked property of TreeNode. To check a node, set this property to True, otherwise set it to False


How can I determine the check-state of a node?
(Demonstrated in sample application : NodeInformation)

You should use the CheckState property of TreeNode.


How can I get the child, parent or next or previous sibling node of a node?
(Demonstrated in sample application : NodeHierarchy)

You should use the Child, Parent, NextSibling and PreviousSibling properties respectively.


How can I show the 'Properties' dialog box for a folder/file?
(Demonstrated in sample application : NodeInformation)

You should use the ExecuteShellCommand method of TreeNode.


How can I open a folder/file in FolderView.Net Control?
(Demonstrated in sample application : NodeInformation)

You should use the ExecuteShellCommand method of TreeNode.


How can I execute commands like 'Cut', 'Copy', 'Paste', 'Delete', etc. for a folder/file?
(Demonstrated in sample application : NodeInformation)

You should use the ExecuteShellCommand method of TreeNode.


How can programmatically expand or collapse a node?
(Demonstrated in sample application : NodeInformation)

You should use the Expanded property of TreeNode. To expand a node, set this property to True, to collapse a node, set this property to False.


How can I get the full path of a folder/file?
(Demonstrated in sample application : NodeInformation)

You should use the Path property of TreeNode.


How can I assign user-defined data for a node?
(Demonstrated in sample application : n/a)

You should use the UserData property of TreeNode to store your data. This property can be set in the NodeAdd event and freed ( if required ) in the NodeDelete event.


How can I use the FolderView.Net Controls with FileView.Net and ShComboBox.Net controls?
(Demonstrated in sample application : Explorer)

FolderView can be used with ShComboBox and FileView to create an entire Windows Explorer with custom functionality. All you need to do is write two simple lines of code!! For more information, see Shell MegaPack.