当前位置:首页
开发技术指南» 文章正文
    引言:
 

 

 ·vss的问题    »显示摘要«
    摘要: vssexplore中,文件前的图标不一致 正常情况,是一页文档的那种,现在有的文件前面的图标是三页纸的那种 听说是复制引起的,盼详细解答 ......
    摘要: 一般玩那种? 我喜欢玩 柳暗花明(填充类)的,不过感觉很费眼睛的。 ......


错在哪

我想把LABEL1中的内容加到LIST2中,但要保证加的内容LIST2不存在,   有2个COMMAND,   1个是加,还有1个是把LIST1的全加的LIST2中,  
  当我用完“全加”命令后,本来再按“加”,应该什么也没加的,但不知为什么,它居然有加?  
   
  兄弟们,帮我看下哪错了?该怎么改?急!  
  附:“加”的命令  
  Private   Sub   Command1_Click()  
  test   =   False  
  For   x   =   0   To   List2.ListCount-1  
        If   Label1.Caption   =   List2.list(x)   Then  
        test   =   True  
      End   If  
  Next   x  
   
  If   test   =   False   Then  
      List2.AddItem   Label1.Caption  
      End   If  
  Label1.Caption   =   ""  
   
  End   Sub  
 

NO.1   作者: IwantFlay

For   x   =   0   To   List2.ListCount-1  
   
      test=false  
      Label1.Caption   =   ""  
   
      If   Label1.Caption   =   List2.list(x)   Then  
          test   =   True  
      End   If  
   
      If   test   =   False   Then  
            List2.AddItem   Label1.Caption  
      End   If  
  Next   x  
   
  If   test   =   False   Then  
      List2.AddItem   Label1.Caption  
      End   If  
  Label1.Caption   =   ""

NO.2   作者: qj82715

在判断相同以后要跳出循环,不相同就设置test=False  
  添加时加入判断         If   Label1.Caption   =   ""   Then   Exit   Sub  
  否则会加入空记录  
   
  Private   Sub   Command1_Click()  
  Dim   test   As   Boolean  
  Dim   x   As   Integer  
   
  test   =   False  
  For   x   =   0   To   List2.ListCount   -   1  
        If   Label1.Caption   =   List2.List(x)   Then  
              test   =   True  
              Exit   For  
        Else  
              test=False  
        End   If  
  Next  
   
  If   test   =   False   Then  
      If   Label1.Caption   =   ""   Then   Exit   Sub  
      List2.AddItem   Label1.Caption  
  End   If  
  Label1.Caption   =   ""  
   
  End   Sub  
   
 

NO.3   作者: ztchen

给个建议,不要这样做,先分析一下思路。  
  1.当list1的项加入到list2时,是否可以将list1内该项删除。  
  private   sub   commandadd_click()  
  list2.additem   list1.list(list1.listindex)  
  list1.removeitem   list1.listindex  
  if   list1.listcount=0   then   commandadd.enabled=false  
  end   sub  
  2.因为每次加过去后都会将所加项删除,所以剩下的就只是未加到list2的项,全家时就可以全部加到list2\  
  private   sub   commandaddall_click()  
  for   ix=0   to   list1.listcount-1  
      list2.additem   list1.list(ix)  
      list1.removeitem   0  
  next  
  end   sub  
  不知道这样的做法是否能够满足你的需求,但这样是比较简单的做法

NO.4   作者: luckii1

Private   Sub   Command1_Click()  
  test   =   False  
  For   x   =   0   To   List2.ListCount-1  
  test   =   False加这里        
  If   Label1.Caption   =   List2.list(x)   Then  
        test   =   True  
      End   If  
  Next   x  
   
  If   test   =   False   Then  
      List2.AddItem   Label1.Caption  
      End   If  
  Label1.Caption   =   ""  
   
  End   Sub  
 


 ·这是为什么    »显示摘要«
    摘要: 错误报告: nafxcwd.lib(thrdcore.obj) : error lnk2001: unresolved external symbol __endthreadex nafxcwd.lib(thrdcore.obj) : error lnk2001: unresolved external symbol __beginthreadex debug/fibonacciseque......
» 本期热门文章:

©2000-2007 All Rights Reserved. 最佳浏览:1024X768 MSIE