User Tools

Site Tools


k6:k6.9:k6.9.2:start

6.9.2 DirView

The DirView (gb.form) control is a (specialised) TreeView that displays directories and their subdirectories according to a directory icon with the corresponding directory name.

The path to the selected directory is returned in the Current property.

B1
Figure 6.9.2.1: DirView with display of the selected directory in a label.

The control can be created:

Dim hDirView As DirView
hDirView = New DirView ( Parent As Container ) As "EventName"

6.9.2.1 Properties

The DirView class has the following properties:

PropertyData typeDescription
CurrentStringReturns the selected, highlighted directory in the DirView.
HideRootBooleanReturns False if the root directory is visible or sets the value for visibility.
PicturePictureReturns the picture that is displayed in front of the root directory or sets the picture.
RenamingBooleanReturns True if a directory is renamed.
Settings Variant[ ]Returns or assigns the configuration of the DirView. The configuration is stored in a Variant array in an unspecified format. Note: Since the Settings property serves as an interface to the gb.settings component, which allows graphical controls to serialise and re-read their own state, you should refrain from using this property.
ShowHiddenBooleanReturns True if the directories are hidden or sets the value for their visibility.

Table 6.9.2.1.1 : Properties of the DirView class

6.9.2.2 Methods

The DirView class has these methods, among others:

MethodDescription
NewFolder( )Starts the creation of a new directory within the current (selected) directory. The process can be cancelled with ESC. If the name of the new directory to be created already exists, then after an error message 'Directory cannot be renamed. File already exists' a new directory with the name 'New Directory' will be created!
Reload( )Updates the content of the view.
Rename( )Starts the renaming of the current (selected) directory. The process can be cancelled with ESC. If the new name of the directory already exists, then after an error message 'Directory cannot be renamed. File already exists' the old name is kept.

Table 6.9.2.2.1 : Methods of the DirView class

6.9.2.3 Events

The following table describes selected events of the DirView class:

EventDescription
Activate()This event is triggered when a directory in the DirView is double clicked.
Icon(Path As String)This event is fired when the control needs to get the icon for a specific file or directory. Path is the file path.
Menu()This event is triggered when the user requests a pop-up menu.
Select()This event is triggered when the user selects a directory.

Table 6.9.2.3.1 : Selected properties of the DirView class.

Notes:

  • For example, you can store the path to the selected directory in a (public) variable sDirPath with sDirPath = DirView.Current and thus make the path available throughout the project.
  • Whether you use the event DirView_Click() or DirView_Select() or DirView_Activate() for this is irrelevant.

The DirView control has no context menu.

Download

Project

Download

The website uses a temporary session cookie. This technically necessary cookie is deleted when the browser is closed. You can find information on cookies in our privacy policy.
k6/k6.9/k6.9.2/start.txt · Last modified: 16.01.2022 (external edit)

Page Tools