<script language='vbscript'>
    sub Actlistview1_ondblclick()
      frm_SJTJ.hn_KeyValue.value=parent.fr_tree.window.document.Acttreeview1.KeyValue
      frm_SJTJ.hn_FKeyValue.value=parent.fr_tree.window.document.Acttreeview1.FKey
      dim strTmp
      strTmp=Actlistview1.strSYDH
      if strTmp<>"null" then
        dim strGCMC,strGCID,strGLID,strQSZH,strZZZH,strCBR,strSBDH,strSEND,strQZZH
        dim pos,length
        if strTmp<>"新增" then'用户点击的不是新增
          pos=Instr(strTmp,";")
          strGCMC=Left(strTmp,pos-1)'工程名称
          strTmp=mid(strTmp,pos+1,len(strTmp))
          document.frm_SJTJ.hn_GCMC.value=strGCMC
          
          
         
          pos=Instr(strTmp,";")
          strQZZH=Left(strTmp,pos-1)
          strTmp=mid(strTmp,pos+1,len(strTmp))
          pos=InStr(strQZZH,"~")
          strQSZH=Left(strQZZH,pos-1)'起始桩号
          strZZZH=mid(strQZZH,pos+1,len(strQSZH))'终止桩号
          document.frm_SJTJ.hn_QSZH.value=strQSZH
          document.frm_SJTJ.hn_ZZZH.value=strZZZH
          
          
          pos=Instr(strTmp,";")
          strTmp=mid(strTmp,pos+1,len(strTmp))          pos=Instr(strTmp,";")
          strTmp=mid(strTmp,pos+1,len(strTmp))          pos=Instr(strTmp,";")
          strGCID=Left(strTmp,pos-1)'GCID
          strTmp=mid(strTmp,pos+1,len(strTmp))
          document.frm_SJTJ.hn_GCID.value=strGCID
          
          pos=Instr(strTmp,";")
          strGLID=Left(strTmp,pos-1)'GLID
          strTmp=mid(strTmp,pos+1,len(strTmp))
          document.frm_SJTJ.hn_GLID.value=strGLID          pos=Instr(strTmp,";")
          strCBR=Left(strTmp,pos-1)'承包人
          strTmp=mid(strTmp,pos+1,len(strTmp))
          document.frm_SJTJ.hn_CBR.value=strCBR
         
          pos=Instr(strTmp,";")
          strSBDH=Left(strTmp,pos-1)'试验编号
          strTmp=mid(strTmp,pos+1,len(strTmp)) 
          document.frm_SJTJ.hn_SBDH.value=strSBDH
          
                        
          strCBRBH=document.frm_SJTJ.hn_CBRBH.value+""
          strGLDJ=document.frm_SJTJ.hn_GLDJ.value+""
          strGCBH=document.frm_SJTJ.hn_GCBH.value+""
          frm_SJTJ.submit
        else
          strGCMC=document.frm_SJTJ.hn_GCMC.value+"" '工程名称
          strQSZH=document.frm_SJTJ.hn_QSZH.value+"" '起始桩号
          strZZZH=document.frm_SJTJ.hn_ZZZH.value+"" '终止桩号
          strGCID=document.frm_SJTJ.hn_GCID.value+"" '工程ID 
          strGLID="0" '管理ID---------------------------------------- 
          strCBR=document.frm_SJTJ.hn_CBR.value+""  '承包人
          strSBDH=document.frm_SJTJ.hn_SBDH.value+"" '试表代号
          strCBRBH=document.frm_SJTJ.hn_CBRBH.value+""'承包人编号
          strGLDJ=document.frm_SJTJ.hn_GLDJ.value+""'公路等级
          strGCBH=document.frm_SJTJ.hn_GCBH.value+""'工程编号
           frm_SJTJ.submit
        end if
      end if
    end sub
    
    
</script>

解决方案 »

  1.   

    不太懂,你的Actlistview1_ondblclick是在脚步里定义的响应控件事件的函数,可是怎么把这个函数同ActiveX控件的事件绑定呢? 
      

  2.   

    很简单啊,,用JAVASCRIPT真接调用ACTIVEX的方法或属性就OK..前提是你必须把ACTIVEX注册.然后在网页中嵌入 我用这个做了一个读写磁卡,远程通讯,划帐的联合收费系统,,挺好用的
      

  3.   

    那是脚本调用ActiveX的方法,反过来,我想知道有没有办法让ActiveX调用JavaScript里的方法呀?