清除对话框中的文本框 [英] Clear textboxes in a dialog

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

问题描述

我创建了一个网络电话项目.登录后,我会看到一个带有注销按钮的新窗口.我的登录窗口有两个文本框.当我注销时,我会看到登录窗口,但是先前的信息出现在该文本框中.

注销后如何在项目中单击,如何获得明文框?

I have created a web phone project. When I log in then I get a new window with logout button. My login window has two textboxes. When I log out then I get the login window but the previous information is present in that text box.

How can I get the clear text boxes after logout click in my project?

推荐答案

如果您的登录表单验证了用户名和密码,则只需在验证后设置myUserIDTextBox.Text = "";等但在关闭/隐藏登录表单之前.

如果登录表单只是将UserID和密码传递给主表单进行验证,则将信息存储在私有成员中,设置textboxes =",然后使用私有成员将信息传递给主表单.

简而言之,在离开登录表单之前,请确保不再需要文本框的内容,然后清除它们.
If your login form verifies the user and password then simply set myUserIDTextBox.Text = ""; etc after verification but before closing/hiding the login form.

If the login form simply passes the UserID and Password to the main form for verification then store the information in private members, set the textboxes = "", and then pass the information to the main form using the private members.

To put it simply, before leaving the login form, make sure that the content of the textboxes is no longer required and clear them then.


关于答案,亨利写道myUserIDTextBox.Text = "";
如果您使用的是 C ++/clr (即托管的C ++ ),那是正确的.如果您以本机语言编写应用程序,则可以编写myUserIDTextBox.SetWindowText(_T(""));
On is answer, Henry wrote myUserIDTextBox.Text = "";
That''s is right if you are using C++/clr (i.e. managed C++). If you are writing your application as native you can write myUserIDTextBox.SetWindowText(_T(""));


这篇关于清除对话框中的文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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