I am exploring ways to alert user without using dialog boxes. Desktop Alert kind of alerting is perfect because it can made to show in the corner and disappears on its own without user interaction. Ideally I would like the alert to show within the user control instead of outside. The implementation I have seen it show outside the application I am running.
Thanks!
Hello,
From the argument you could get LinkClikedArgs and to check LinkRef property, which will returns you the bold part of the formatted text:
"Link to <a href=\"http://ko.infragistics.com\"> Infragistics</a>.";
MessageBox.Show(e.LinkClickedArgs.LinkRef);
Also if it is needed you could cancel opening of the link and to perform your custom action:
e.LinkClickedArgs.OpenLink = false;
Please let me know if you have any further questions.
Actually I posted my question after implementing your solution. I noticed there was only handler.
I am guessing the key is using to using LinkClickedArgs? I read this one . My question is how does the handler know which of the two link (two href's ) was clicked?
It seems that you haven’t tested my sample code, because it display “Link to Infragistics.” in Text area, so in the text area you could have a text with several links in it, not only one.
Please let me know if you have any further questions or for some reason you are not able to implement code snipped .
Thanks Hristo. This is good info. I was unaware of buttons on the alert box and it definitely increases the choices to consider. I will see how the requirements play out with regard to button versus links using text.
In case I am required to implement as links using text, I am guessing it would tricky because (if I am not mistaken) there is only one link handler available. How would I do it for two or more links?
Yes you could have two links in your alert window, but before do that please consider the approach to have a buttons for your options. On the following link you will find a tutorial of how to use alert buttons:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2012.2/CLR4.0/html/WinDesktopAlert_Adding_Alert_Buttons_to_the_Desktop_Alert_Reminder.html
I hope that this will helps you.