Folderbrowserdialog Unmasked: Everything You Wanted to Know About the Folder Browser Component From.net Framework

Author: admin  |  Category: net framework 3.5  |  Comments (0)  |  Add Comment

Original Article :http://www.ssware.com/articles/folderbrowserdialog-unmasked-everything-you-wanted-to-know-about-the-folder-browser-component-from-dotnet-framework.htm

Introduction

The FolderBrowserDialog, available as part of the .Net framework, provides a folder browser component for your C# and VB.Net applications. The UI consists of a modal dialog which contains a tree control displaying all the files and folders on the system. The user can then browse and select a folder from the tree. The full path of the selected folder is then returned.

Basic Usage

To display a folder explorer UI to the user, a FolderBrowserDialog instance is created and the ShowDialog method is called. This shows the modal dialog containing the folder browser control (tree) and an OK and Cancel button. If the user selects a folder and clicks the OK button, the ShowDialog method returns DialogResult.OK and the SelectedPath property contains the full path of the selected folder. If the user clicks the Cancel button, the ShowDialog method returns DialogResult.Cancel.

Advanced Usage

The FolderBrowserDialog has some additional features such as limiting the view of the file system that is displayed to the user, pre-selecting a folder when the dialog is first displayed and displaying a button to allow the user to create a new folder.

The RootFolder property can be set to the full path of the folder which is to be displayed as the root of the tree control of the folder browser component. For example, if this property is set to Environment.SpecialFolder.Personal, only folders from the ‘My Documents’ are displayed in the tree, so the user can only select ‘My Documents’ or its sub-folders.

Prior to displaying the folder browser control, the SelectedPath property can be set to the full path of a folder causing that folder to be pre-selected in the folder browser tree. For example, when this property is set to "c:", the node corresponding to the c: drive is pre-selected in the tree when the dialog is first displayed.

If the ShowNewFolderButton property is set to true, then, in addition to the folder browser tree control, and the OK and Cancel buttons, the folder browser dialog also displays an additional ‘New Folder’ button which when clicked, creates a new folder under the currently selected folder.

Limitations

While the folder browser component is a handy way to allow the users to browse and select folders, it suffers from many limitations, some of them preventing the component from being of practical use in applications.

Modal Functionality

The most visible drawback of the folder browser component is that it displays its UI in the form of a modal dialog. When shown, it blocks the rest of the application until the user has chosen a folder. As long as the dialog is displayed, no input (keyboard or mouse click) can occur except within the dialog box. The user must click the OK or Cancel button before input to the calling program can occur.

This is a very annoying and limiting feature of the FolderBrowserDialog. Users are very likely to be irritated and annoyed when they have to interact with a modal dialog every time they have to explore and select a folder. A non-modal UI control which can be put inside of one of the applications’s own forms or dialogs is a much more user-friendly way of displaying the same UI.

No Virtual (Non-file system) folders

The FolderBrowserDialog does not allow the user to select virtual (Non-file system) folders such as the Control Panel or My Computer. It only allows the user to select a file system path such as "c:" or "c:windows".

No Files

The component does not allow the user to select files. This is a major drawback since there are many circumstances where the user may need to select a file while still using the tree UI to browse to that file.

Limited Choice of RootFolder

The root folder of the folder browser control can be only set to one of the ’special folders’ defined by Windows such as the ‘My Documents’ or ‘My Computer’. This is a major limitation since this means you cannot set the root folder to a path such as the "d:" drive.

No Check Boxes

The folder explorer tree in the FolderBrowserDialog cannot show check boxes next to nodes. Ability to show multi-state check boxes can be a very handle feature for such a control.

No Filtering

The FolderBrowserDialog has no support for filtering. For example, it is not possible to display only network folders or only shared folders or only folders starting with the string "Documents" or files having a particular extension.

No Custom Controls

When using the FolderBrowserDialog, you are only limited to the actual folder explorer tree control, the OK, Cancel and New Folder buttons and the description label. It is not possible to add custom controls to the dialog box. This can be useful in many circumstances such as when you want to show a thumbnail/preview of the selected file/folder or any kind of additional information.

No Appearance Control

The appearance of the FolderBrowserDialog and its constituent controls cannot be changed. Neither can attributes of individual folders show in the folder explorer control be changed. For example, it is not possible to change the background color of the tree control or to set the font and color of individual nodes/folders in the tree.

No Custom items

The FolderBrowserDialog cannot display external/custom items in the folder explorer tree. For example, it may be necessary to display items from an FTP location in addition to the file system items. This is not possible with the FolderBrowserDialog.

No Lockdown

The FolderBrowserDialog allows unhindered operations on folders. The user can rename folders, do drag-drop operations and display the context menu and invoke various operations. In many cases, it may be necessary to limit or altogether prevent such potentially dangerous and irreversible operations, however the FolderBrowserDialog provides no way of doing that.

Beyond The FolderBrowserDialog : The FolderView Control

The FolderView Control brings a Windows Explorer like folder browser component to your applications complete with AutoUpdate, dragdrop, icons, contextmenus, Non-file system items, default key-handling, infotips and renaming. It features powerful behavior control and customization functionality that takes it miles ahead of Windows Explorer by adding features like filtering, checkboxes, custom items, multiple root nodes, dragdrop control and customization of default contextmenus, displaynames, icons and infotips.

The FolderView control is a UI control which can be dropped right inside your own forms and dialogs. A non-modal file & folder browsing/selection experience right inside your own dialogs and forms is something that users will appreciate and find intuitive and simple.

Additionally, FolderView overcomes all the limitations of the FolderBrowserDialog and provides far greater and advanced features and functionality than the FolderBrowserDialog. The following table is a quick comparison of the FolderView Control with the FolderBrowserDialog.

Drop-In Windows Explorer like folder browser functionality.

FolderView Control : Yes

FolderBrowserDialog : Modal UI. The component cannot be dropped in your own form.



Complete Windows Explorer functionality include a file/folder browsing listview (similar to Windows Explorer’s right-side) and a drive selection control (similar to Windows Explorer’s address bar)

FolderView Control : Yes. As part of
Shell MegaPack

FolderBrowserDialog : No

Ability to select virtual (Non-file system) folders

FolderView Control : Yes

FolderBrowserDialog : No

Ability to specify any and all folders as root.

FolderView Control : Yes

FolderBrowserDialog : No

Ability to show files as well as folders.

FolderView Control : Yes

FolderBrowserDialog : No

Multi-state check boxes

FolderView Control : Yes

FolderBrowserDialog : No

Filtering capabilities

FolderView Control : Yes

FolderBrowserDialog : No

Custom controls

FolderView Control : Yes

FolderBrowserDialog : No

Appearance Control

FolderView Control : Colors and appearance of the control as a whole and of individual folders/files can be changed.

FolderBrowserDialog : No.

Custom Items

FolderView Control : Yes

FolderBrowserDialog : No

Prevent renaming, drag-drop, context menus

FolderView Control : Yes. For all folders or on a per-folder basis.

FolderBrowserDialog : No

Multiple root folders

FolderView Control : Yes

FolderBrowserDialog : No

Change default display names, icons, overlay icons, infotip, etc

FolderView Control : Yes

FolderBrowserDialog : No

Simply and easy to use API

FolderView Control : Yes

Clumsy, inflexible API

Access complete information of a file/folder including its displayname, fullpath, checkstate, selection state and attributes like whether it is a shortcut, shared, hidden, readonly, file and folder.

FolderView Control : Yes

FolderBrowserDialog : No

Prevent display of contextmenus for all folders using a simple property or on a per-folder basis using an event.

FolderView Control : Yes

FolderBrowserDialog : No

Prevent dragdrop for all folders using a simple property or on a per-folder basis using an event.

FolderView Control : Yes

FolderBrowserDialog : No

Allow/disallow renaming for all folders using a simple property or on a per-folder basis using an event.

FolderView Control : Yes

FolderBrowserDialog : No

Allow/disallow selection for all folders using a simple property or on a per-folder basis using an event.

FolderView Control : Yes

FolderBrowserDialog : No

Allow/disallow expanding/collapsing on a per-folder basis using an event.

FolderView Control : Yes

FolderBrowserDialog : No

Change default drag actions during dragdrop (e.g. from Copy To Move)

FolderView Control : Yes

FolderBrowserDialog : No

Control checking/unchecking on a per-folder basis.

FolderView Control : Yes

FolderBrowserDialog : No

Prevent execution of default shell commands ( e.g. Open, Cut, Properties, etc. in response to keystrokes or through the context menu) for all folders using a simple property or on a per-folder basis using an event.

FolderView Control : Yes

FolderBrowserDialog : No

Show/hide hidden folders using a simple property.

FolderView Control : Yes

FolderBrowserDialog : No

Show/hide virtual folders ( e.g. Control Panel ) using a simple property.

FolderView Control : Yes

FolderBrowserDialog : No

Enumerate all folders shown in FolderView.

FolderView Control : Yes

FolderBrowserDialog : No

Enumerate all folders according to folder hierarchy structure.

FolderView Control : Yes

FolderBrowserDialog : No

Execute shell commands ( e.g. Cut, Delete, etc ) on folders.

FolderView Control : Yes

FolderBrowserDialog : No

Associate developer defined data with each folder

FolderView Control : Yes

FolderBrowserDialog : No



The FolderView control (and Shell MegaPack ) is available in two editions :

.Net Edition : For use in .Net development using Windows Forms, WPF and ASP.Net

ActiveX Edition : For use in applications developed using Visual C++/MFC/ATL, Visual Basic 6, VBA (Access, Word, Excel, AutoCAD,etc), Borland Delphi and Borland Builder, and HTML/ASP pages.

Article.net Framework

Author: admin  |  Category: net framework 3.5  |  Comments (0)  |  Add Comment

The .NET framework (DotNet)is a new Microsoft initiative directed to the modification of computer world. More specifically, it is a large set of development tools, servers, software, and services. Its main advantages for the user are creation of an integrated information space connecting him or her with computers and programs, as well as connection software applications together. For developers, the value of dotNet lies in interoperability and the seamless connectivity of multiple systems and sources of data. This empowers them to quickly and easily create required products.

The IT department manager of every company has a dream — an enterprise that performs all business transactions with partners exceptionally over the Internet, with no headaches about the business processes. For this to happen, the processes must be well designed, stable, and easily customized and controlled both from the local network and from any computer in the Internet. All company’s employees should have general access to work information, Email and personal documents no matter if they use mobile phone, Pocket PC, Notebook or high-end workstation.

why .NET Framework so needed?

Better Performance

The .net developers make usage of advanced compilation and caching techniques to there by making server applications faster in .NET Framework. Developer Productivity

The .NET developers reap huge productivity gains by using .net class libraries helping in over all memory management. Powerful Security

The common security prototype effectively handles exposure to destructive software tools or utilities. Integration with Existing Systems

The .net programmers takes benefit provided by COM technology and programs against them as though they were originally written using the .NET Framework. The Native XML Web Services Support, available with Microsoft .NET , and the Java Language Conversion Assistant (JLCA) help to .net programmer convert the existing Visual Basic 6.0 and Microsoft Visual J++ code to run on the .NET Framework. Easy Deployment

The deployment and managing application in .NET Framework are easier for .net developer. With No-Touch Deployment, Windows-based smart client applications are deployed to and updated on target PCs simply by copying the necessary components to a Web server. The automatic version control of components helps .net programmer prevent versioning conflicts. Mobility Support

Single unified programming model in .net framework provides .net programmers in developing smart client and web applications for both PCs and mobile devices such as personal digital assistants (PDAs) and mobile phones. Support for More Than 20 Programming Languages

The support and integration of over 20 programming languages by .net framework enables .net developers to choose the right programming language. The various components written in different languages can interact seamlessly, with no COM plumbing required. Flexible Data Access

Web based data access is possible with interaction with .NET technology. The .net developers use ADO.NET which provides options like neutral platform, XML-based cache of the requested data, also instead of directly manipulating the database there by providing greater scalability.

Secure Browsing in a Shared.net Framework Intranet

Author: admin  |  Category: net framework 3.5  |  Comments (0)  |  Add Comment

 

Think of all the students in a school computer lab or office workers in a shared corporate NET framework environment. Even if they should know better, everyone indulges in personal Internet browsing, surfing adult, gaming, video and social networking sites. But there is no such thing as leaving no tracks, right? Anyone can peek into the contents of History or the Favorites list. When PC’s are shared, moreover, there is no safety in saving addresses in the Favorites list even if one uses it often enough. There is always the risk that the network Admin will give vent to his curiosity and delete “non-business” Net addresses. So, how does one work around these “hindrances”?

While modeling an e-commerce project based on the NET framework with the folks at Nashua, NH, -based HyTech Professionals the other day, one developer demonstrated how to use a neat utility called WebTool (author: George Bodnar). One simply stores the executable file on a memory stick. On loading, you see a list of Internet addresses and a button. Select the address wanted, press the button and WebTool opens a new instance of Internet Explorer.

This works only in a NET framework environment because the platform does not require a registry entry to run an executable. NET depends on “xcopy deployment”, not caring that the sys admin has not authorized a program but finding and running components automatically.

Of course, I should emphasize at this point that this workaround should not be used for idling away executive time or corporate bandwidth. But there are justifiable circumstances for covering one’s tracks, such as in a two- or three-shift contact center environment operating on the NET framework. So it is worth keeping WebTool in mind when pursuing a confidential project for the boss. Unless you are absolutely sure you are okay with having other users of the PC learn about the next “lean and mean” rightsizing exercise or acquisition talks perhaps. No? I didn’t think so.

Because your time and money are valuable, you deserve a solutions orientated software development firm that can deliver high quality solutions on time for a great price. Our distinct selling point is the ability to convert our client’s vision into a cost effective and efficient business solution. We believe our unique approach to offshore outsourcing combines significant cost benefits with lower risks and higher levels of customer service. In a highly competitive international environment, HyTech Professionals distinguishes itself by providing the following advantages:

 



HyTech Professionals is a Microsoft Gold Certified Partner and ISO 9001 Certified software engineering services company, delivering top quality results on which our clients can depend.

We have U.S.-based project managers to ensure that the risks associated with offshore outsourcing are minimized, and accountability is increased. You do not have to worry about issues like cultural differences, time differences, communication gaps, etc

As an employee owned IT firm, all of our staff are committed to helping our clients succeed. Our people are our greatest assets, and as such, we invest heavily in training, our internal mentorship program, and MS/ISO certification. Our programmers bring years of software development experience, domain expertise, and a desire to help you succeed in your business goal.

By employing world-class software developers in India, HyTech Professionals ensures high quality programming along with significant savings for each one of our clients.

HyTech Professionals maintains 24/7 service support staff equipped with the latest technologies and secured systems.

We strive to build long-term relationships with our clients. HyTech Professionals nurtures a company culture of helping our clients beyond expectations, even when we have to go that extra mile. Our organization’s values revolve around customer satisfaction, quality delivery, privacy protection, promoting equal opportunity, flexibility and integrity.