ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / Developing an application or website / Controls, windows and pages / Controls: Available types / TreeView control
  • Image associated with an element
  • Associating one or more images with an element
  • Image format
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Associating an image with an element in a TreeView control
Image associated with an element
Each element in a TreeVew control is preceded by an image. This image can be different depending on the state of the current element (or level). You can display an image:
  • when the level is expanded,
  • when the level is collapsed or is a leaf node.
Example of TreeView control in a WINDEV application:
TreeView control
Example of a collapsed level image: Collapsed level image
Example of an expanded level image: Expanded level image
Remark: You can also associate an identifier with an element. For more details, see Associating an identifier with an element.
Associating one or more images with an element
To associate one or more images with an element of a TreeView control, simply specify the name (and path, if necessary) of the desired image when using the following functions:
TreeAddAdds a "leaf" element (and all necessary nodes) into a TreeView control.
TreeInsertInserts a leaf into a TreeView control at a specific position.
TreeModifyModifies an element (node or leaf) in a TreeView control.
These functions are also available in prefix syntax:
<TreeView>.AddAdds a "leaf" element (and all necessary nodes) into a TreeView control.
<TreeView>.InsertInserts a leaf into a TreeView control at a specific position.
<TreeView>.ModifyModifies an element (node or leaf) in a TreeView control.
Remark: If no specific image is associated with the elements of a TreeView control, the "closed folder" (Closed folder) and "open folder" icons (Open folder) are used.
Image format
The following image formats are supported in Windows:
  • Bitmap (*.BMP)
  • Graphics Interchange Format (*.gif)
  • Joint Picture Experts Group (*.jpg ; *.jpeg)
  • Kodak Photo CD (*.pcd)
  • PaintBrush (*.pcx)
  • Adobe Photoshop Format (*.psd)
  • TrueVision TARGA (*.tga)
  • Tagged Image File Format (*.tif ; *.tiff)
    Remark: the "tiled tiff" option of tiff 6.0 standard is not supported. In this case, we advise you to save the image in tiff 5.0 standard.
  • Portable Network Graphics (*.png)
  • Windows MetaFiles (*.emf ; *.wmf)
  • Icons (*.ico ; *.icw)
    Remarks:
    • HQ display (High Quality) available.
    • Management of sheets in transparent BMP format (32 bits).
  • Cursors (*.cur)
  • Portable Document Format (*.pdf)
  • Scalable Vector Graphics (*.svg)
  • WINDEV images (generated by the image editor, *.WDPIC).
WEBDEV - Server code The recognized image formats are as follows: GIF, JPEG, PNG or SVG (depending on the browsers).
The images used can be:
WEBDEV - Server code Only image files can be used. These files must be in the "<ProjectName>_WEB" directory. These images are not transformed when the page is saved. There is no need to use fWebDir to specify the image path. This path is relative to the "<ProjectName>_WEB" directory.
Remarks:
  • The specified image is proportionally reduced: the height of the image corresponds to the height of the row in the TreeView control. The size of the images used should be set to 16x16 pixels (size of the small WINDEV icons).
  • Magenta areas in the images will be transparent at runtime.
Minimum version required
  • Version 9
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/01/2024

Send a report | Local help