C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




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: Points: 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  
(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!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use