我们自己程序里面有个 webbrowser 开了一个 网页,当点击一个网页的 链接的时候,结果怎么了?
因为系统的默认浏览器是IE或者遨游,这个新的页面结果就跑到它们那里去了,我想点了链接,新页面还是在自己的 程序里面的webbrowser里面打开,
请问高手怎么才能实现?
小弟,先谢谢。

解决方案 »

  1.   

    没有人呀。 很 棘手呀。
    我 把 链接的 target = parent 改成 target = self还是不行哟。
      

  2.   

    我是这么做的,
    在WebBrowser1下面放一个WebBrowser2,然后。....procedure TForm1.WebBrowser1NewWindow2(ASender: TObject; var ppDisp: IDispatch; var Cancel: WordBool);
    begin
      ppDisp:=WebBrowser2.Application;
    end;procedure TForm1.WebBrowser2BeforeNavigate2(ASender: TObject; const pDisp: IDispatch; var URL, Flags, TargetFrameName, PostData, Headers: OleVariant; var Cancel: WordBool); 
    begin
      WebBrowser1.Navigate(URL);
      Cancel:=True;
    end;
      

  3.   

    我还是 贴出来 这个 html的 源文件吧
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>支付宝支付</title>
    </head>
    <form name="alipaysubmit" method="post" action="https://www.alipay.com/cooperate/gateway.do?_input_charset=utf-8" target="self">  
      <input type=hidden name="body" value="账户冲值">
      <input type=hidden name="notify_url" value="http://localhost:8080/zfb/alipay_notify.jsp">
    <input type=hidden name="out_trade_no" value="Thu Apr 02 09:28:25 CST 2009">
    <input type=hidden name="partner" value="2088002261493964">
    <input type=hidden name="payment_type" value="1"> 
    <input type=hidden name="seller_email" value="[email protected]">
    <input type=hidden name="service" value="create_direct_pay_by_user">
    <input type=hidden name="sign" value="1e72f19f3af4876be9a60b76134d6461"> 
    <input type=hidden name="sign_type" value="MD5">      
    <input type=hidden name="subject" value="账户冲值">
    <input type=hidden name="total_fee" value="0.01">
    <input type=hidden name="show_url" value="www.sina.com.cn">
    <input type=hidden name="return_url" value="http://localhost:8080/alipay_return.do">
    <input type=hidden name="paymethod" value="">
    <input type=hidden name="defaultbank" value="ICBCB2C">
    <table>
    <tr>
    <td>
    <input type='button' name='v_action' value='支付宝网上安全即时支付平台' onClick='document.alipaysubmit.submit()'>
    </td>
    </tr>
    </table>
    </form>
    <body>
    </body>
    </html>