我尝试用self.Width和self.Height来进行调整,无效?很急,请各位高手不
吝帮帮在下,先谢了!

解决方案 »

  1.   

    不要使用自动生成的htm,自己再做一个:
    <body leftmargin=2 topmargin=2>
    <script language="JavaScript">
    <!--
            document.write("<OBJECT  classid='clsid:75C57EE9-675E-4BD9-8A56-8353C091C0D5'")
            document.write(" codebase='/CAACHDC/CAACHDC.inf#Version=1,0,3,0'")          
            document.write(" width=")
            document.write(screen.width/800*776)
            document.write(" height=")
            document.write(screen.height/600*500)
            document.write(" align=center")
            document.write(" hspace=0")
            document.write(" vspace=0>")
            document.write(" </OBJECT>")
    -->
    </script>
    </body>替换body中的相应代码,我的效果是满屏(IE)显示,并且随分辨率的不同自动满屏
      

  2.   

    谢谢,可我需要并不是满屏效果,而是随时调整控件自身的大小,而且不是通过客户端脚本实现,我需要通过Activex自身的事件实现,高手们在吗?我真的急用!谢谢!
      

  3.   

    原来是这样!留下你的email,给你一个范例
      

  4.   

    还是贴出源码吧:定义:    var
        cs:IOLeClientSite;
        sp:IServiceProvider;
        ie:IWebbrowser2;加timer控件procedure TActiveFormX.Timer1Timer(Sender: TObject);
    begin
        cs := ActiveFormControl.ClientSite;
        sp := cs as IServiceProvider;
        sp.QueryService(IWebbrowserApp, IWebbrowser2, ie);    //STYLE:=GETWINDOWLONG(IE.HWND,GWL_STYLE);
        //STYLE:=STYLE AND NOT WS_SYSMENU;
        //SETWINDOWLONG(IE.HWND,GWL_STYLE,STYLE);
        //IE.MenuBar:=FALSE;    TIMER1.Enabled:=FALSE;
    end;设置宽度:procedure TActiveFormX.Button7Click(Sender: TObject);
    var
    DoC: IHTMLDocument2;
    Txt: IHTMLTxtRange;
    ocxcollection: IHTMLElementCollection;
    ocx:IHTMLElement;begin
       Doc := ie.Document as IHTMLDocument2;
       {doc.execCommand('selectall',true,'');
       doc.execCommand('BackColor',false,'BLUE');   Txt :=Doc.selection.createRange as IHTMLTxtRange;
       Txt.findText('a',0,0);
       Txt.select;}
       //   ocxcollection:=doc.applets ;
       ocx:=ocxcollection.item('aaa',0) as IHTMLElement;
       ocx.style.width:=strtoint(edit1.Text);
       //self.color:=doc.bgColor;
       //doc.parentWindow.resizeTo(400,400);
       //DOC.forms可用作操作HTML表担中的元素
    end;全屏
       ie.FullScreen:=true;
    关闭
       IE.Quit;
    恢复
      ie.FullScreen:=false;
      

  5.   

    呵呵,来迟了。干嘛要这么麻烦,就将<object>元素的Width和Height属性设为100%不就行了嘛。