hi,
I want to add some string(expression : e.g. #{name}# or ${name}$). When I add this expression it should appear as link in the UltraFormattedTextEditor. And also when I clcik on that it should trigger an event.
is there any way to do that?
If yes, Please give me some sample example
Thanks in advance,
Regards,
Santosh
Hi Santosh,
I find that the easiest way to learn how to do something in the UltraFormattedTextEditor is to use the designer. If you place an UltraFormattedTextEditor on a form and go to the Value property, you can click the button to bring up the designer.
The designer has a button on the toolbar to allow you to add a link. You can use the two tabs to see what the control will look like and also to see the XML that is created to achieve that look.
So you could set the Value on the control to something like this:
<a href="url">Display text</a>
Then you just handle the LinkClicked event and set e.OpenLink to true. This will prevent the control from trying to launch the URL you provided automatically. You can then handle it however you want.
Appologies for replying to an old thread but i experience this issue still in version 11.1.20111.2009 (have yet to update to latest release).
For those people that are searching for a solution i found that easiest way to have a new entry be recognized immediately as a URL is to simply store the text property in the value property again in the lostfocus event.
Private Sub txtEMail_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtEMail.LostFocus
txtEMail.Value = txtEMail.Text
End Sub
EDIT: validating events works too.
Obviously would still be nice the control would do this as soon as you type something. :)
Kind regards,Jacob Iedema
Hello Jacob,
I believe that you could use the 'ValueChanged' event for that matter. It will fire on any change such as deleting char or adding a char.
Please feel free to let me know if I misunderstood you or if you have any other questions.
I already tried that but it will throw you a System.StackOverflowException which i can understand because i'm guessing it will be in endless loop.
Hello,
You are right.
The 'KeyDown' event of the control then might help you. Could you please tell me if it suits your needs. I will be happy to assist you further on that matter.
Good idea indeed.
'KeyUp' works even better cause with KeyDown it will cause flickering when you actually want to click the link with Ctrl-click.
Thx for the suggestion.
Jacob Iedema