IntraWeb中如何屏蔽鼠标右键,
在HTML中一般加上这句就可以了,但是在IntraWeb中不行
<body oncontextmenu="window.event.returnValue=false">
200分,高手们帮忙啊

解决方案 »

  1.   

    {
        函数说明:禁用右键弹出菜单
    }
    procedure TFrm_Real.ProcessMsg(var Msg:TMsg;var Handled:boolean);
    begin
        with Msg do
        if((message=WM_RBUTTONDOWN) or
          (message=WM_RBUTTONDBLCLK)) or
          (message=WM_CONTEXTMENU) then
        begin
            Handled:=true;
        end;
    end;Form Create事件中加上:
        Application.OnMessage:=ProcessMsg;
      

  2.   

    试用模板就可以解决问题。在窗体上放置TIWTemplateProcessorHTML控件,然后设置窗体的布局管理器(LayoutMgr)为刚才放TIWTemplateProcessorHTML控件,建一个html模板,在body部分加上oncontextmenu="window.event.returnValue=false"就可以了。已经在iw9.21下测试过。
    具体的去找一下csdn中的intraweb资料吧.
      

  3.   

    不用模板的方法(适用于ie):
    在窗体的属性Javascript中
    加如下代码
    ------------------------------
    function click1()
    {
            if(event.button==2)                                  
            {
            //  return true;
                  alert('    对不起鼠标右键已被屏蔽!');   
            }
    }document.onmousedown=click1;
    -------------------------------------
      

  4.   

    return   true; 
    这个无效