如何关闭连接对话框? [英] how to close the dialog box on connection?

查看:84
本文介绍了如何关闭连接对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在vc ++ MFC中制作了一个对话框/窗体,该对话框/窗体应该从用户(用户名,密码)获取输入,如果username,password是正确的,则显示消息以另一种形式连接,并且如果输入不正确该表格不应关闭.我的代码如下:

I have made a dialog box/form in vc++ MFC which should take the inputs from user(username,password)and if the username ,password is correct it shows the message connecting in another form,and if the inputs are not correct the form should not close. my code is below:

void LoginCredentials::OnBnClickedOk()
{
    // TODO: Add your control notification handler code here
    if (UpdateData(TRUE))
    {
        this->ShowWindow(FALSE);
    }
    else
    {
      this->ShowWindow(TRUE);
    }

}


但是即使输入不正确,表单也会关闭..任何人都可以帮助我或建议我,将提供任何帮助.


but even if the inputs are incorrect,form gets closed..can anybody help me or suggest me,any kind of help will be appreciated.

推荐答案

可能是您的密码检查不正确.请发布相关代码.

谢谢
May be your password checking is incorrect. Please post relevant code.

Thanks,


这篇关于如何关闭连接对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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