JVCL Help:TJvRichEdit.OnURLClick

From Project JEDI Wiki
Jump to navigationJump to search
JEDI Visual Component Library Help

Search in JVCL Help

 
Search in all projects
 

Summary

Occurs when the user clicks the mouse when the mouse pointer is over text that is a link.


Pascal

 propertyOnURLClick: TRichEditURLClickEvent;


Parameters

Parameters Description
Sender Rich Edit control that has fired this event.
URLText Specifies the text with the link attribute the user clicked.
Button Identifies the mouse button the user used to click the text.


Description

Write an OnURLClick event handler to respond when the user clicks the mouse when the mouse pointer is over text that is marked as a link. Text that is marked as a link typically identifies a range of text that contains an URL. Applications can handle the OnURLClick event by For example starting a browser to view the location identified by the URL as specified by parameter URLText.
To set or unset the link attribute for a section of text, select the text and use the Link property of the rich edit control’s SelAttributes property.
If you set AutoURLDetect to true to enable automatic URL detection, the rich edit control automatically sets the link attribute for modified text that it identifies as a URL.
Example: procedure TForm1.JvRichEdit1URLClick(Sender: TObject; const URLText: string;

 Button: TMouseButton);
begin
if Button = mbLeft then
ShellExecute(Handle, nil, PChar(URLText), nil, nil, SW_SHOW);
end;


See Also

TJvCustomRichEdit.AutoURLDetect, TJvTextAttributes.Link


About

Notes

Rich Edit 2.0


Contribute to this help topic

This documentation wiki is based on the collaborative effort of Project JEDI users. Your edits are welcome in order to improve documentation quality: edit this page