vb代码翻译

来源:百度知道 编辑:UC知道 时间:2024/06/23 04:26:18
Private Sub EffectCmd_Click(Index As Integer)
Dim i, j, k As Integer
Dim temp As Long
MainForm.Visible = False
Select Case Index
Case 0: '向外展开
For i = 0 To 600
ShowForm.Height = i * 5
ShowForm.Width = i * 8
ShowForm.Left = (Screen.Width - ShowForm.Width) \ 2
ShowForm.Top = (Screen.Height - ShowForm.Height) \ 2
ShowForm.Label1.Left = (ShowForm.Width - ShowForm.Label1.Width) \ 2
ShowForm.Label1.Top = (ShowForm.Height) \ 2 - ShowForm.Label1.Height
ShowForm.Visible = True
Next

Case 1: '向内缩小
For i = 600 To 0 Step -1
ShowForm.Height = i * 5
ShowForm.Width = i * 8
ShowForm.Left = (Screen.Width - ShowForm.Width) \ 2
ShowForm.Top = (Screen.Height

Private Sub EffectCmd_Click(Index As Integer) '此过程是点击effectcmd数组控件时执行的代码
Dim i, j, k As Integer'定义几个变量
Dim temp As Long '同上
MainForm.Visible = False'设置mainform窗体不可见
Select Case Index '检查按钮数组控件的序列号
Case 0: '向外展开 ’当index为0时
For i = 0 To 600 '循环开始,此过程是让窗体从小到大变化
ShowForm.Height = i * 5 'showform窗体的高度赋值为i*5,简单说就是改变showform这个窗体的高度
ShowForm.Width = i * 8 '改变showform窗体的宽度
ShowForm.Left = (Screen.Width - ShowForm.Width) \ 2’本句与下句是改变窗体的left和top值,为了让窗体显示在屏幕的正中央
ShowForm.Top = (Screen.Height - ShowForm.Height) \ 2
ShowForm.Label1.Left = (ShowForm.Width - showForm.Label1.Width) \ 2'本句与下句是改变showform窗体中的label1标签的left和top值,简单就是让这个标签位于窗体中央
ShowForm.Label1.Top = (ShowForm.Height) \ 2 -showForm.Label1.Height
ShowForm.Visible = True '设置showform窗体可见
Next '循环

Case 1: '向内缩小 ’当index为1时
For i = 600 To 0 Step -1 '循环开始,此过程是让窗体从大到小
ShowForm.Hei