PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK

  • 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/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
..AutomaticLink is used to find out the mode for automatic detection of links in the multiline edit controls and to enable (or not) this mode. This property is available for the text and RTF edit controls.
When this property is enabled, the links found in the specified edit control 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 run with the text of the link in 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.
Note: This property is equivalent to the "Allow the links" option found in the "Details" tab of the description window of edit controls.
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 Name>..AutomaticLink
<Result>: Boolean
  • True if the mode for automatic detection of links is enabled,
  • False otherwise.
<Control Name>: Character string (with or without quotes)
Name of edit control to use.

Modifying the mode for automatic detection of links Hide the details

<Control Name>..AutomaticLink = <Enabled/Disabled>
<Control Name>: Character string (with or without quotes)
Name of edit control to use.
<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 have the ability to intercept the click performed by the user on a link found in an edit control. All you have to do is:
  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

Links in UNC format: 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
Video Link
https://youtu.be/w-i2AykGczU

https://windevdesenvolvimento.blogspot.com/2019/02/dicas-2011-windev-comandos-44.html
amarildo
08 Feb. 2019
Video AutomaticLink
https://youtu.be/RKXDzyDG2Zo

https://windevdesenvolvimento.blogspot.com/2019/02/dicas-2010-windev-comandos-43.html


// BTN_AUTOMATICLINK

// VAMOS FAZER COM QUE DENTRO DO EDT, POSSAMOS TER LINK
// LET'S DO WITHIN EDT, WE CAN HAVE LINK
// Ajoutons un calculateur à la valeur indiquée


EDT_Text1..AutomaticLink=True
amarildo
07 Feb. 2019
 interested in having this feature in WebDev
In WebDev it would be very interesting to have this feature of Autolink in any text field.
In my case I save links in a Table control so this feature would allow me to click directly over the link. Now I have to a do a copypaste of the link.
Josep Castany
10 Feb. 2016