一、控件添加到form中后,会在form上显示出来。如果有的位置放置错误看不到,在对象属性列表中也可以看到它。
二、在模块中定义一个public变量,通常在sub main()中对它进行赋值,注意要在工程属性中把启动过程设置为sub main()。

解决方案 »

  1.   

    工程菜单->添加模块,然后在模块中用PUBLIC关键字定义
    如:PUBLIC a as long
    则a始终能够用。
      

  2.   

    '希望这个对你有点用
    Private Sub Command1_Click()
    Dim Obj As Control
        For Each Obj In Me '本form
            Print Obj.Name '打印所有的名称
        Next Obj
    End Sub
      

  3.   

    Private Sub Command1_Click()
    Dim Obj As Control
    Dim pd As Boolean
        For Each Obj In Me '本form
            Print Obj.Name '打印所有的名称
            If Obj.Name = "Command2" Then pd = True '判断存在Command2否
        Next Obj
        
        If pd Then
            Print "存在Command2"
        Else
            Print "不存在Command2"
        End If
    End Sub
      

  4.   

    UP在Modual模块上里用public 定义一个变量就可以在整个工程中应用了
    比如:public gCon as new Adodb.connection