试试改成
If zct.Opened AndAlso forms.ActiveForm IsNot Nothing AndAlso forms.ActiveForm.Name = zct.Name Then