单击“确定"按钮时,消息框出现问题 [英] problem on messagebox while click OK button

查看:63
本文介绍了单击“确定"按钮时,消息框出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Private Sub cb_party_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles cb_party.GotFocus
               If cb_from.Text = cb_to.Text Then
            MsgBox(" From and To doesn't same")
        End If
    End Sub


运行此代码时,显示msgbox.但在消息框中单击确定"按钮,该框将不会关闭.如果我们尝试关闭均值,它将不会关闭.如何解决此问题.....


while running this code, msgbox display. but click OK button in the message box, that box won''t close. if we try to close means, it won''t close. how to solve this.....

推荐答案

当控件获得焦点时,将显示消息框.这将使您的注意力从您的控制权移开,并显示消息.,
单击确定,框关闭,并且焦点返回到您的控件.
显示消息框.这将焦点从...上移开了.


并重复.

最好的解决方案?不要在那里做,或者不要通过消息框进行报告.请使用标签或类似的标签来报告问题.
When your control gets the focus, you display the message box. Which takes focus away from your control, and displays the message.,
You click ok, the box closes, and focus goes back to your control.
Which displays the message box. Which takes focus away from ...


And repeat.

Best solution? Don''t do it there, or don''t report via a message box. Use a label, or similar to report the problem instead.


这篇关于单击“确定"按钮时,消息框出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆