漏问一个,如何在鼠标点中里listbox中一项时,判断它是第几项?

解决方案 »

  1.   

    1、
    dim i as long,j as long,Str() as string
    j=list1.listcount '得到总的项数
    redim Str(j-1)
    for i=0 to j-1
        Str(i)=List1.List(i) '得到每项的值
    Next
    .....鼠标点中里listbox中一项时,判断它是第几项的方法是察看他的List1.ListIndex
    2。如何修改以下代码使其合法
      dim a as string 
      a= 路径
      a.readonly=False我不知道你的意图是什么,没法修改。
      

  2.   

    dim astrA() as string 
    astrA()=list1.list()
      

  3.   

    不好意思,漏打一个。我的意思是选中一项时判自动断它是第几项,然后用一个按钮的click事件自动删除它
      

  4.   

    1、同意 xxfeiyu(潇湘飞雨) 
    2、
    if dir(a)<>"" then
       SetAttr a, vbReadOnly
    end if
    3、自动删除
    if List1.ListIndex>=0 then
       list1.RemoveItem list1.ListIndex 
    end if
      

  5.   

    不好意思,第二题看错了,原来你是去掉只读
    if dir(a)<>"" then
       SetAttr a,  vbArchive
       Kill a
    end if