本文介绍了VB.net中带有计时器的垃圾邮件框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我在下面有这段代码,当表单出现时,将处理垃圾邮件消息框.

Ok, I have this code below, when a form will appear, a message box spam will be in processed.

Private Sub form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
 
timer.Start()

Private Sub timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrnote.Tick
        MsgBox("I got you!", vbCritical, "LOL")



但是,我希望仅显示10个消息框,然后将其置于顶部,并显示另一种形式.这个怎么做?



However, I want that only 10 messagebox to appear then after that it will be topped, and another form will appear. How to do this? It''s a prank software, I''m doing.

推荐答案

Private Sub timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrnote.Tick
Static iCount as Integer
    if iCount <10 then MsgBox("I got you!", vbCritical, "LOL")
    iCount = iCOunt +1


或全局变量:


or global variable:

Dim iCount As Integer = 0
Private Sub timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrnote.Tick
    if iCount >10 then MsgBox("I got you!", vbCritical, "LOL")
    iCOunt = iCount+1



这篇关于VB.net中带有计时器的垃圾邮件框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-23 08:27