PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN

  • Intercepting the click performed on a link in an edit control
  • Limitation
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
The AutomaticLink property is used to:
  • determine if the automatic link detection mode is enabled,
  • enable or disable the automatic link detection mode.
This property is available for:
  • multiline Edit controls..
  • Versions 27 and later
    Word Processing controls.
    New in version 27
    Word Processing controls.
    Word Processing controls.
When this property is enabled for an Edit control, links are automatically displayed as clickable links. The following links are taken into account:
  • URLs. For example, "http://www.windev.com".
  • full paths or UNC paths to a file. For example, "C:\temp\MyImages.gif". The link is displayed only if the file exists.
When the user clicks this link, the corresponding file is automatically displayed (ShellExecute is automatically executed with the text of the link as parameter). The click can be intercepted by the WM_USER + 853 event (see the Notes).
To select the link (without opening the document), all you have to do is press the Ctrl key.
Versions 27 and later
When this property is enabled for a Word Processing control, links are detected during input, after pressing Space, Tab or Enter. If these links already exist, they can be opened with Ctrl + Click.
New in version 27
When this property is enabled for a Word Processing control, links are detected during input, after pressing Space, Tab or Enter. If these links already exist, they can be opened with Ctrl + Click.
When this property is enabled for a Word Processing control, links are detected during input, after pressing Space, Tab or Enter. If these links already exist, they can be opened with Ctrl + Click.
Remark: This property is equivalent to:
  • the "Display and enable the links" option in the "Details" tab of the Edit control description window.
  • Versions 27 and later
    the "Automatically detect and format links" option in the "General" tab of the Word Processing control description window.
    New in version 27
    the "Automatically detect and format links" option in the "General" tab of the Word Processing control description window.
    the "Automatically detect and format links" option in the "General" tab of the Word Processing control description window.
Example
// Enables the automatic detection of links
EDT_Edit1.AutomaticLink = True
Syntax

Finding out the mode for automatic detection of links Hide the details

<Result> = <Control used>.AutomaticLink
<Result>: Boolean
  • True if the mode for automatic detection of links is enabled,
  • False otherwise.
<Control used>: Control name
Name of the control to be used:
  • Edit control,
  • Versions 27 and later
    Word Processing control.
    New in version 27
    Word Processing control.
    Word Processing control.

Modifying the mode for automatic detection of links Hide the details

<Control used>.AutomaticLink = <Enabled/Disabled>
<Control used>: Control name
Name of the control to be used:
  • Edit control,
  • Versions 27 and later
    Word Processing control.
    New in version 27
    Word Processing control.
    Word Processing control.
<Enabled/Disabled>: Boolean
  • True to enable the mode for automatic detection of links,
  • False otherwise.
Remarks

Intercepting the click performed on a link in an edit control

You can intercept the click performed by the user on a link found in an edit control. Simply:
  1. Declare the event process in the initialization code of the window (WM_USER + 853 in this case).
    Event("proc_click", "*.*", WM_USER + 853)
  2. Create the procedure called by Event. The content of this procedure will be run before starting the application associated with the link.

Limitation

UNC links in an Edit control: The link is not entirely displayed if the path contains a space character. The link should be enclosed in quotes.
Minimum version required
  • Version 11
Comments
Click [Add] to post a comment