VB性能记录

21 篇文章 0 订阅
7 篇文章 0 订阅
这篇博客专注于记录作者在Visual Basic(VB)环境中编写的测试程序和测试代码,旨在探讨和评估VB的性能表现。
摘要由CSDN通过智能技术生成

此贴专门用来记录,我在VB中写的测试程序,与测试代码

VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "Form1"
   ClientHeight    =   6945
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   9045
   LinkTopic       =   "Form1"
   ScaleHeight     =   6945
   ScaleWidth      =   9045
   StartUpPosition =   3  '窗口缺省
   Begin VB.Timer Timer1 
      Interval        =   100
      Left            =   3960
      Top             =   3240
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Command1"
      Height          =   495
      Left            =   1080
      TabIndex        =   0
      Top             =   3360
      Width           =   1215
   End
   Begin VB.Shape Shape2 
      Height          =   735
      Index           =   0
      Left            =   8160
      Top             =   720
      Width           =   735
   End
   Begin VB.Shape Shape1 
      Height          =   735
      Left            =   480
      Top             =   720
      Width           =   735
   End
   Begin VB.Line Line1 
      X1              =   240
      X2              =   8880
      Y1              =   1080
      Y2              =   1080
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim strTmp1 As String
Dim lngTime As Long
Dim strArray1() As String
Dim i1 As Integer, ii2 As Integer
Private Sub Form_Load()
'
    strTmp1 = "a,a,a,a,b,b,a,b,b"
    i1 = 0
    
    strArray1 = Split(strTmp1, ",")
    
    Call createShape
    Debug.Print UBound(strArray1)
    Debug.Print Me.Shape2.UBound
    lngTime = 0
End Sub

Private Sub Timer1_Timer()
'
    Dim l1 As Long
'    Call test1
'    Call shape_move1
'    If i1 >= ii2 Then i1 = 1
'    i1 = i1 + 1
    Debug.Print i1
    
    
    Call shape_move2(Me.Shape2(i1))
    
End Sub

Sub test1()
'
    If i1 > 4 Then i1 = 0
    i1 = i1 + 1
    Me.Shape1.Shape = i1
    Print i1
    
End Sub

Private Sub shape_move1()
'
    Me.Shape2(0).Left = Me.Shape2(0).Left - 100
    
End Sub

Private Sub shape_move2(shpTmp1 As Shape)
'
    shpTmp1.Left = shpTmp1.Left - 100
    
    
End Sub

Private Sub createShape()
'
    Dim i1 As Integer, i2 As Integer
    Debug.Print UBound(strArray1)
    i2 = 0
    For i1 = 0 To UBound(strArray1)
        Debug.Print strArray1(i1)
        If strArray1(i1) = "a" Then
            i2 = Me.Shape2.UBound + 1
            Load Shape2(i2)
'            Shape2(i2).Left = 0
'            Shape2(i2).Top = 0
            Shape2(i2).Shape = 2
            Shape2(i2).Visible = True
             
        End If
        If strArray1(i1) = "b" Then
            i2 = Me.Shape2.UBound + 1
            Load Shape2(i2)
'            Shape2(i2).Left = 0
'            Shape2(i2).Top = 0
            Shape2(i2).Shape = 4
            Shape2(i2).Visible = True
        End If
    Next i1
    
    ii2 = Me.Shape2.UBound
    Debug.Print ii2
End Sub


评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值