FileView.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 items, 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, ListItem and item 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 FileView.Net Control with my application?
To deploy your application which uses FileView.Net Control, include only the SkySoftware.FileView.dll assembly file with your installation program. FileView does not have any dependencies, so SkySoftware.FileView.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 FileView.Net Control legal agreement for complete information.
Licensing and registration
How can I enter license information in the FileView.Net Control after I have purchased a license?
After you have purchased the FileView.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 "FileView Licensed = True". If valid information is not present, the line will read "FileView 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 FileView.Net control.
The line should be similar to the following line :
SkySoftware.FileViewControl.FileView, SkySoftware.FileView, 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.FileView assembly from your project. Then reinsert the reference to the SkySoftware.FileView assembly and do a 'Rebuild All' on your project. This should refresh the licenses.licx file with the line corresponding to the FileView.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 FileView.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 "FileView Licensed = True". If valid information is not present, the line will read "FileView 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 FileView.Net Control?
(Demonstrated in sample application : StarterSample)
You can display your own text or icons for files/folders shown in FileView.
To change the text shown for a ListItem, you should use the Text property. You can change this property for each node in the AfterItemAdd event which is called after each item is added.
To change the icons shown for a ListItem, you should use the IconIndex property. You can change this property for each node in the AfterItemAdd event which is called after each item is added.
How can I change the font and colors used by FileView.Net Control?
(Demonstrated in sample application : n/a)
You should use the Font, BackColor and TextColor 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 listview control?
(Demonstrated in sample application : StarterSample)
You should use the BorderStyle, FlatScrollBar, FullRowSelect, HeaderSortArrowImageStyle, HotTracking, ShowGridLines and TrackSelect properties for customization.
How can I change the column name, column text justification or the column width in 'Details' view?
(Demonstrated in sample application : Customization)
You should use the ColumnName, ColumnTextJustification and ColumnWidth properties.
How can I change the column text displayed for a file/folder in 'Details' view?
(Demonstrated in sample application : Customization)
You should use the ColumnText property of ListItem.
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 ListItem.
How can show/hide the check box for individual items?
(Demonstrated in sample application : Customization)
You should set the ShowCheckBox property of ListItem to True/False to show/hide the check box respectively.
How can I add custom columns in Report mode?
(Demonstrated in sample application : Customization)
You should use the AddCustomColumn method. You can set the column text for individual items by using the ColumnText property of ListItem in the AfterItemAdd event or anytime after that.
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 FileView?
(Demonstrated in sample application : Customization)
You should use the AddCustomItem to add custom items.
How can I set a background image for FileView?
(Demonstrated in sample application : n/a)
You should use the SetBackgroundImage method.
Behavior control ( e.g. prevent opening of files)
How can I prevent the user from changing the current folder?
(Demonstrated in sample application : StarterSample)
You should set the AllowDiveIntoFolders property to False.
How can I prevent the user from opening files by double-clicking on them?
(Demonstrated in sample application : StarterSample)
You should set the AllowFileExecution property to False.
How can I prevent the user from selecting multiple files/folders?
(Demonstrated in sample application : StarterSample)
You should set the AllowMultipleSelection property to False.
How can I disable the default behavior of FileView.NetControl to keystrokes like 'Del' and 'Ctrl-C', etc.?
(Demonstrated in sample application : StarterSample)
Just set the DefaultKeyHandling property to False.
How can I prevent the background menu from appearing when the user right-clicks on a blank area in the control?
(Demonstrated in sample application : n/a)
You should set the ShowBackgroundMenu property to False.
How can I prevent context menus from appearing when a file/folder is right-clicked?
(Demonstrated in sample application : StarterSample)
You should set the ShowContextMenus 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 ItemChecking event.
How can I prevent certain columns from displaying in 'Details' view?
(Demonstrated in sample application : BehaviorControl)
You should set the Add parameter to False in the BeforeColumnAdd event.
How can I prevent a specific file from opening or from going down into a certain folder?
(Demonstrated in sample application : BehaviorControl)
You should set the Cancel parameter to True in the ItemDblClick event.
How can I allow dragdrop only within FileView or only from FileView to an external window?
(Demonstrated in sample application : n/a)
You should use the DragDropSettings property.
How can I prevent InfoTips from displaying when the mouse is held over a file or folder?
(Demonstrated in sample application : StarterSample)
You should set the ShowInfoTips property to False.
How can I prevent an item from being selected?
(Demonstrated in sample application : n/a)
You should set the Cancel parameter to True in the BeforeSelectionChange 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 certain items from being renamed?
(Demonstrated in sample application : BehaviorControl)
You should set the Cancel parameter to True in the BeforeLabelEdit event.
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 ItemRightClick event.
How can I prevent the display of or change the default infotips shown for files and folder?
You should use the GetInfoTip event.
How can I prevent a dragdrop operation from starting on a per-item basis or prevent a drop action on a per-item basis or change the default drop action (e.g. from copy to move)?
You should use the FileViewStartDrag, FileViewDragDrop and FileViewDragOver events.
Filtering ( e.g. show only files)
How can I allow only files of a certain extension to be shown in FileView?
(Demonstrated in sample application : StarterSample)
You should use the FilePattern property.
How can I show only files in the FileView.Net Control?
(Demonstrated in sample application : StarterSample)
You should set the ShowFolders property to False.
How can I prevent non-filesystem folders/files or hidden folders/files from displaying?
(Demonstrated in sample application : StarterSample)
You should set the ShowSpecialFolders and ShowHiddenItems properties to False.
How can I prevent a certain item from displaying in FileView.Net Control?
(Demonstrated in sample application : n/a)
You should use the Delete method of ListItem. A good place to call this method is in the AfterItemAdd event.
General
How can I determine the current folder for which FileView.Net Control is displaying contents?
(Demonstrated in sample application : StarterSample)
You should use the CurrentFolder or the CurrentPIDL properties. The CurrentFolder property returns the full path of the current folder and hence can only be used for fileystem folders. CurrentPIDL can return the Pidl even for non-filesystem folders such as 'Control Panel'
How can I enumerate all the folders/files shown in FileView.Net Control?
(Demonstrated in sample application : EnumerateItems)
To enumerate through all the nodes, you should use the ListItem property.
To see the code, open the EnumerateItems sample application that comes with FileView.
How can I enumerate all the selected folders/files shown in FileView.Net Control?
(Demonstrated in sample application : EnumerateItems)
You should use the FirstSelectedItem and NextSelectedItem properties to do so. To see the code, open the EnumerateItems sample application that comes with FileView.
How can I determine the total number of items and total number of selected items in FileView?
(Demonstrated in sample application : EnumerateItems)
You should use the ItemCount and SelectedCount properties respectively.
How can I programmatically change the current folder for which FileView.Net Control displays contents?
(Demonstrated in sample application : StarterSample)
You should use the CurrentFolder and CurrentPidl properties. To see the code, open the StarterSample sample application that comes with FileView.
CurrentFolder only accepts filesystem paths. To set the current folder to a non-filesystem folder like 'Control Panel' use the CurrentPIDL property.
How can I reset the current folder to the Desktop?
(Demonstrated in sample application : StarterSample)
You should use the ResetToDesktop method.
How can I change the display mode of FileView.Net Control to 'Details' view?
(Demonstrated in sample application : StarterSample)
You should use the ViewStyle property.
How can I refresh the FileView?
(Demonstrated in sample application : n/a)
You should use the RefreshView method.
How can I show checkboxes for every item?
(Demonstrated in sample application : StarterSample)
You should set the ShowCheckBoxes property to True.
How can I programmatically select a specific item in FileView.Net Control?
(Demonstrated in sample application : n/a)
You should use the GetItemFromName method along with the Selected property of ListItem.
How can I determine if an item is a file or a folder?
(Demonstrated in sample application : ItemInformation)
You should use the Attributes property of ListItem.
How can I determine if an item belongs to the filesystem?
(Demonstrated in sample application : ItemInformation)
You should use the Attributes property of ListItem.
How can I determine if an item is a shortcut?
(Demonstrated in sample application : ItemInformation)
You should use the Attributes property of ListItem.
How can I determine if an item is readonly or hidden?
(Demonstrated in sample application : ItemInformation)
You should use the Attributes property of ListItem.
How can I determine if an item is a custom item?
(Demonstrated in sample application : ItemInformation)
You should use the IsCustom property of ListItem.
How can I programmatically check/uncheck a node?
(Demonstrated in sample application : ItemInformation)
You should use the Checked property of ListItem.
How can I determine the check-state of an item?
(Demonstrated in sample application : ItemInformation)
You should use the Checked property of ListItem.
How can I determine if a file/folder is selected?
(Demonstrated in sample application : ItemInformation)
You should use the Selected property of ListItem.
How can I programmatically go to the parent folder of the current folder?
(Demonstrated in sample application : StarterSample)
You should use the GoUp method.
How can I show the 'Properties' dialog box for a folder/file?
(Demonstrated in sample application : ItemInformation)
You should use the ExecuteShellCommand method of ListItem.
How can I programmatically open a file and go into a folder in FileView.Net Control?
(Demonstrated in sample application : n/a)
You should use the OpenItem method of FileView.
How can I execute commands like 'Cut', 'Copy', 'Paste', 'Delete', etc. for a folder/file?
(Demonstrated in sample application : ItemInformation)
You should use the ExecuteShellCommand method of ListItem.
How can I execute all the above commands for the current folder?
(Demonstrated in sample application : n/a)
You should use the ExeCmdForFolder method.
How can I execute all above commands for all the selected items in FileView?
(Demonstrated in sample application : ItemInformation)
You should use the ExeCmdForAllSelected method.
How can I get the full path of a folder/file?
(Demonstrated in sample application : ItemInformation)
You should use the Path property of ListItem.
How can I assign user-defined data for an item?
(Demonstrated in sample application : n/a)
You should use the UserData property of ListItem to store your data. This property can be set in the AfterItemAdd event and freed ( if required ) in the BeforeItemDelete event.
How can I use the FileView.Net Control with the FolderView.Net and ShComboBox.Net Controls?
(Demonstrated in sample application : Explorer)
FileView can be used with ShComboBox and FolderView 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.
|