嵌套?
对象要求还要有子集合
比如
listview1.listitem.item(i).subitem(2)="hello"
每层用 . 区分

解决方案 »

  1.   

    with me
       .top=1
       .height=1
       .width=1
       .unload
    end with
    '十分?有点太扣了吧
      

  2.   

    嵌套的 With 语句似乎没有什么意义。下面是MSDN中相关说明:可以将一个 With 块放在另一个之中,而产生嵌套的 With 语句。但是,由于外层 With 块成员会在内层的 With 块中被屏蔽住,所以必须在内层的 With 块中,使用完整的对象引用来指出在外层的 With 块中的对象成员。
      

  3.   

    With 语句示例
    本示例使用 With 语句对某单一对象执行一系列的语句。MyObject 对象及其属性均为示范目的而采用了通用名称。With MyObject
       .Height = 100      ' 和 MyObject.Height 一样等于 100 。
       .Caption = "Hello World"   ' 和 MyObject.Caption 一样等于 "Hello World" 。
       With .Font
          .Color = Red      ' 和 MyObject.Font.Color 一样等于 Red。
          .Bold = True      ' 和 MyObject.Font.Bold 一样等于 True 。
       End With
    End With
      

  4.   

    With MyObject
       .Height = 100      ' 和 MyObject.Height 一样等于 100 。
       .Caption = "Hello World"   ' 和 MyObject.Caption 一样等于 "Hello World" 。
       With .Font
          .Color = Red      ' 和 MyObject.Font.Color 一样等于 Red。
          .Bold = True      ' 和 MyObject.Font.Bold 一样等于 True 。
       End With
    End With
    以上这样是可以,
    ********但如果是两个不同的对象这样处理,我试了一下以下代码出错********With MyObject
       .Height = 100      ' 和 MyObject.Height 一样等于 100 。
       .Caption = "Hello World"   ' 和 MyObject.Caption 一样等于 "Hello World" 。
       With otherobject
    .Color = Red      ' 和 MyObject.Font.Color 一样等于 Red。
          .Bold = True      ' 和 MyObject.Font.Bold 一样等于 True 。
       End With
    End With