Click here to Skip to main content
15,890,670 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Guys,

How can we use a link label in default message box of win forms using VB.NET/C# ? So, user can be directed to specific link (i.e. email address).
Please, help me to achieve this. Thanks

Regards,
itz.irshad
Posted

1 solution

The default MessageBox of Windows Forms is displayed through static method Show (which has got several overloads).
Since the MessageBox dialog is constructed internally by the Show static method, we have no access to this dialog for adding additional elements like LinkLabel. So, I think, as an alternative a Form can be created, which will serve as MessageBox, according to the requirement and a static method Show similar to that of MessageBox class, with required overloads, may be defined in this form to instantiate and display the MessageBox (Form).
 
Share this answer
 
v2
Comments
Itz.Irshad 10-Apr-12 9:04am    
Well,

The alternate option is good for communicating information via custom message box ,but 'look and feel' of default message box is dependent of OS on which application is running. That's why I'm looking for this to use. In case of custom message box, I've to design separate message box(s) for application running of Win XP and Win 7 (for example).

Thanks for time.
VJ Reddy 10-Apr-12 10:15am    
In that case, you can consider using Skinned forms as given in this Code Project article
http://www.codeproject.com/Articles/61485/Winforms-SkinFramework
Then the custom MessageBox can match with other elements of your application.
Itz.Irshad 11-Apr-12 1:59am    
So, the summary is that message box cannot be customized to use hyper link? Anyway, Thanks for your time.
VJ Reddy 11-Apr-12 5:14am    
I think, message box cannot be customized for the reason stated in my solution. If the answer is helpful to you, then you may consider to vote and / or accept the solution. Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900