..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.
Remark: This property is equivalent to the "Allow the links" option found in the "Details" tab of the description window of edit controls.
// 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. Simply:
- Declare the event process in the initialization code of the window (WM_USER + 853 in this case).
Event("proc_click", "*.*", WM_USER + 853)
- 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.