首页   |   IT资讯   |   综合资讯   |   开发   |   软件   |   问答   |   网络技术   |   网络综合
更多:
当前位置:首页 » 手机数码
文章正文

关于复制、粘贴和剪切的问题

类型:转载   责任编辑:asp   日期:2007/03/01

    

各位高手:我想在text1中输入一些文本,然后通过复制、粘贴到text2中,可就是不行,总是报参数不对。剪切也一样,不知如何编写?程序如下:  
   
  private   sub   form_load()  
  clipboard.clear  
  end   sub  
   
  private   sub   mnueditcopy_click()  
  if   txtt1.sellength   >   0   then  
          clipboard.settext   =   txtt1.seltext  
  end   if  
  end   sub  
   
  private   sub   mnueditcut_click()  
  if   txtt1.sellength   >   0   then  
          clipboard.settext   =   txtt1.seltext  
          txtt1.text   =   ""  
  end   if  
  end   sub  
   
  private   sub   mnueditexit_click()  
  end  
  end   sub  
   
  private   sub   mnueditpaste_click()  
  if   len(clipboard.gettext)   >   0   then  
          txtt2.seltext   =   clipboard.gettext  
  end   if  
  end   sub  
   
  private   sub   mnusetting_click(index   as   integer)  
  if   index   =   0   then  
      cmdialog1.flags   =   1  
      cmdialog1.showfont  
      txtt1.fontsize   =   cmdialog1.fontsize  
      txtt2.fontsize   =   cmdialog1.fontsize  
  end   if  
   
  if   index   =   1   then  
      cmdialog1.showcolor  
      cmdialog1.showfont  
      txtt1.forecolor   =   cmdialog1.color  
      txtt2.forecolor   =   cmdialog1.color  
  end   if  
  end   sub  
   
 

推荐阅读

  • 电子商务混乱中前行 标准之争再成焦点 [详细内容]
  • 720收发邮件攻略 [详细内容]
  • 国产服务器份额首次超过国外品牌 [详细内容]
  • 美科学家警告:地球网络面临外太空病毒入侵 [详细内容]
  • 《混乱军团》简易流程攻略 [详细内容]
  • 垃圾邮件仍猖狂 小技巧可避大多数搜索程序 [详细内容]
  • 十大黑客事件回顾:固若金汤还是不堪一击 [详细内容]
  • 网友回答:
    网友:fyy117

    private   sub   form_load()  
      clipboard.clear  
      end   sub  
       
      private   sub   mnueditcopy_click()  
      if   txtt1.sellength   >   0   then  
              clipboard.settext   txtt1.seltext  
      end   if  
      end   sub  
       
      private   sub   mnueditcut_click()  
      if   txtt1.sellength   >   0   then  
              clipboard.settext   =   txtt1.seltext  
              txtt1.text   =   ""  
      end   if  
      end   sub  
       
      private   sub   mnueditexit_click()  
      end  
      end   sub  
       
      private   sub   mnueditpaste_click()  
      if   len(clipboard.gettext)   >   0   then  
              txtt2.seltext   =   clipboard.gettext  
      end   if  
      end   sub  
       
      private   sub   mnusetting_click(index   as   integer)  
      if   index   =   0   then  
          cmdialog1.flags   =   1  
          cmdialog1.showfont  
          txtt1.fontsize   =   cmdialog1.fontsize  
          txtt2.fontsize   =   cmdialog1.fontsize  
      end   if  
       
      if   index   =   1   then  
          cmdialog1.showcolor  
          cmdialog1.showfont  
          txtt1.forecolor   =   cmdialog1.color  
          txtt2.forecolor   =   cmdialog1.color  
      end   if  
      end   sub

    网友:rappercn

    clipboard.settext   =   txtt1.seltext  
       
      这里错了,settext是一个方法,不是属性,你可以给属性赋值,却不能给方法赋值,方法只能调用。  
       
      改成   clipboard.settext   txtt1.seltext

    .
      最佳浏览:1024X768 MSIE
    ©2007 jqmk.com.cn All Rights Reserved