用VB编写的程序运行时,点击最小化会出错,然后关闭软件,请问这是什么原因??
PrivateSubForm_Resize()OnErrorResumeNextDimiAsLongFori=PicMain.LBoundToPicMain.UBound...
Private Sub Form_Resize()
On Error Resume Next
Dim i As Long
For i = PicMain.LBound To PicMain.UBound
If PicMain(i).Visible = True Then
PicMain(i).Move 0, 720, Me.ScaleWidth, Me.ScaleHeight - sbStatusBar.Height - OLEArr(0).Height - PicMain(i).Top - 15
OLEMain(i).Move 0, 0, PicMain(i).ScaleWidth, PicMain(i).ScaleHeight
For j = OLEArr.LBound To OLEArr.UBound
If OLEArr(j).Container.Name <> "PicMain" Then
OLEArr(j).Top = PicMain(i).Top + PicMain(i).Height
End If
Next
For j = PicArr.LBound To PicArr.UBound
If PicArr(j).Container.Name <> "PicMain" Then
PicArr(j).Top = PicMain(i).Top + PicMain(i).Height
End If
Next
End If
Next
End Sub 展开
On Error Resume Next
Dim i As Long
For i = PicMain.LBound To PicMain.UBound
If PicMain(i).Visible = True Then
PicMain(i).Move 0, 720, Me.ScaleWidth, Me.ScaleHeight - sbStatusBar.Height - OLEArr(0).Height - PicMain(i).Top - 15
OLEMain(i).Move 0, 0, PicMain(i).ScaleWidth, PicMain(i).ScaleHeight
For j = OLEArr.LBound To OLEArr.UBound
If OLEArr(j).Container.Name <> "PicMain" Then
OLEArr(j).Top = PicMain(i).Top + PicMain(i).Height
End If
Next
For j = PicArr.LBound To PicArr.UBound
If PicArr(j).Container.Name <> "PicMain" Then
PicArr(j).Top = PicMain(i).Top + PicMain(i).Height
End If
Next
End If
Next
End Sub 展开
2个回答
展开全部
Private Sub Form_Resize()
On Error Resume Next
Dim i As Long
If Me.WindowState = 1 Then Exit Sub '如果最小化就退出,防止出错
For i = PicMain.LBound To PicMain.UBound
If PicMain(i).Visible = True Then
PicMain(i).Move 0, 720, Me.ScaleWidth, Me.ScaleHeight - sbStatusBar.Height - OLEArr(0).Height - PicMain(i).Top - 15
OLEMain(i).Move 0, 0, PicMain(i).ScaleWidth, PicMain(i).ScaleHeight
For j = OLEArr.LBound To OLEArr.UBound
If OLEArr(j).Container.Name <> "PicMain" Then
OLEArr(j).Top = PicMain(i).Top + PicMain(i).Height
End If
Next
For j = PicArr.LBound To PicArr.UBound
If PicArr(j).Container.Name <> "PicMain" Then
PicArr(j).Top = PicMain(i).Top + PicMain(i).Height
End If
Next
End If
Next
End Sub
更多追问追答
追问
还是会出错
追答
你先编译看一下是哪句出错(Ctrl+F5),改完后再试试!并把出错的语句放出来看看
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询