C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Articles » .NET Framework »

How disable link navigation in webbrowser control of C#.NET 2005


Posted Date: 27 Jun 2006    Resource Type: Articles    Category: .NET Framework
Author: DotNetJapsMember Level: Gold    
Rating: 1 out of 5Points: 5



We can disable link navigation in web browser control of C#.NET 2005 with help of three events and a creating event handler as following

private bool bCancel = false;

private void webBrowserTandy_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
int i;
for (i = 0; i < webBrowserTandy.Document.Links.Count; i++)
{
webBrowserTandy.Document.Links[i].Click += new

HtmlElementEventHandlerthis.LinkClick);
}
}
private void LinkClick(object sender, System.EventArgs e)
{
bCancel = true;
MessageBox.Show("Link Was Clicked Navigation was Cancelled");
}
private void webBrowserTandy_Navingating(object sender, WebBrowserNavigatingEventArgs e )
{
if (bCancel == true)
{
e.Cancel=true;
bCancel = false;
}
}

For the Vb.NET version of this please refer this link:

http://www.vbdotnetforums.com/showthread.php?p=33394

http://jalpesh.blogspot.com







Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Error Handling in VB.Net
Previous Resource: Printing Invoices in C#
Return to Discussion Resource Index
Post New Resource
Category: .NET Framework


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use