CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Posts
    1

    Problem while clicking link(Win Forms)

    Hi Friends,

    I have one win form where there is a one labellink. When i click on that link it opens pop up window in IE7 explorer. When you click on same link it opens another pop up tab in IE. But i have to avoid that. When you click on that link it should display same tab which is already opened instead of creating new tab. I have tried with

    Code:
    System.Diagnostics.Process proc
    and i have written code like this


    Code:
    try
    
    { 
    
     if (proc.HasExited) 
    
    {
    
    proc =
    
    
    Process.Start("iexplore.exe", "www.google.com"); 
    
    }
     
    else
    
    {
    
    MessageBox.Show("Window is Already Opened!!"); 
    }
    
    }
    catch
    {
    proc = Process.Start("iexplore.exe","www.google.com");
    }
    But here the problem is when you close opened tab and keep another empty tab , click on that link it says that Message already opened.

    I dont know how to solve this. Please give me solution if you know this..
    Thanks in advance..
    Last edited by HanneSThEGreaT; September 1st, 2009 at 08:13 AM. Reason: Code Tags!

  2. #2
    Join Date
    Jun 2008
    Posts
    2,477

    Re: Problem while clicking link(Win Forms)

    Here is a good example which shows you two ways to enumerate through each open IE tab.

    http://www.eggheadcafe.com/community...ys-that-i.aspx

    That said, you should be using the user's preferred browser, not strictly IE. Of course, that would make this more difficult .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured