type   mytype   
  a   as   string   
  b   as   integer   
  ...   
  ...   
    
 end   type    这样定义的类型可以在整个工程中使用吗?
还有,这个定义放在哪里?

解决方案 »

  1.   

    public type   mytype   
      a   as   string   
      b   as   integer   
      ...   
      ...   
        
     end   type    
    放在模块中就行了
      

  2.   

    在标准模块中需如此定义:
    Option Explicit
    Public Type mytype
        a   As String
        b   As Integer
    End TypePublic ss As mytype
    然后可在整个工程使用。
      

  3.   

    标准模块
    type mytype
    a as string
    b as integer
    c as long
    end type
    窗体
    dim mydata as mytype
    mydata.a="hello,i love you!"
    mydata.b=350
    mydata.c=34567
      

  4.   

    Public Type mytype
        a   As String
        b   As Integer
        .    .
        .    .
    End Type或者定义为类模块