VB中While跟定时器结合使用程序一运行就卡死,为什么?求高手解答

VB中While和定时器结合使用程序一运行就卡死,为什么?求高手解答
Public Sub test()
Timer5.Enabled = True
While sign = False
If x = True Then
sign = True
End If
Wend
End Sub

Private Sub Timer5_Timer()
Timer5.Enabled = False
x = True
End Sub
定时器定的是50ms,test函数运行之后,因为sign=false所以处于While循环之中,当定时器被触发以后,就可以跳出While循环了吗?为什么程序一运行貌似就是进入死循环卡死了,一关闭就直接退出VB了?
vb While  定时器

------解决方案--------------------
while中要加个doevents,不然timer一直没在工作