弹出登录对话框 [英] Pop-up login dialog box

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

问题描述

您好,


我在Visual Basic .NET中编程。我看过创建一个

登录表单的例子,用于用户输入他们的用户名和密码,但是我想要用弹出窗口完成同样的事情而是对话框。怎么可以

我让我的程序弹出一个弹出式登录对话框,供用户输入

用户名和密码?


谢谢,

Dusty

解决方案

您可以将登录表单作为对话框调用以下代码:


Dim frmNewDownload As New frmDownload

frmNewDownload.ShowDialog()


这将给你的用户一个对话框,但仍然允许您设计

表格到你的规格。


柯蒂斯


" ; Dusty Hackney < Dusty Ha*****@discussions.microsoft.com >在消息中写道

新闻:2B ********************************** @ microsof t.com ...

您好,

我在Visual Basic .NET中编程。我已经看到了创建
登录表单以供用户输入用户名和密码的示例,但是我想用弹出对话框来完成相同的操作。

如何使我的程序弹出一个弹出式登录对话框,供用户输入用户名和密码?

谢谢,
Dusty



" Dusty Hackney" < Dusty Ha*****@discussions.microsoft.com > schrieb:

我在Visual Basic .NET中编程。我已经看到了创建
登录表单以供用户输入用户名和密码的示例,但是我想用弹出对话框来完成相同的操作。

如何使我的程序弹出一个弹出式登录对话框,供用户输入用户名和密码?




如果您使用的是VS 2005:


选择项目 - > 添加新项目...... - > 登录表格 - > [新增" ;.然后使用

以下代码显示登录对话框:

\\\

使用f作为新的LoginForm ()

如果f.ShowDialog = DialogResult.OK然后

密码= f.PasswordTextBox.Text

用户名= f.UsernameTextBox.Text

结束如果

结束使用

///


-

MS Herfried K. Wagner

MVP< URL:http://dotnet.mvps.org/>

VB< URL:http:// classicvb .org / petition />


Herfried,


\\\
使用f作为新的LoginForm()
如果f.ShowDialog = DialogResult.OK然后
密码= f.PasswordTextBox.Text
用户名= f.UsernameTextBox.Text
结束如果
结束使用
///



这听起来很奇怪,但通常情况下它不需要返回

密码,可以在对话框中查看。一个好的超过

就足够了,而不是代码。


如果f.showdialog<> dialogresult.OK me.close


一个典型的问题。如何在VB2005中获取该错误警告的rit(共享

成员)?


Cor


Hello,

I am programming in Visual Basic .NET. I have seen examples of creating a
login form to use for users to type in their username and password, but I
want to accomplish the same thing with a pop-up dialog box instead. How can
I make my program bring up a pop-up login dialog box for a user to type in
username and password?

Thanks,
Dusty

解决方案

You can call a login form as a dialog box with the following code:

Dim frmNewDownload As New frmDownload
frmNewDownload.ShowDialog()

That will give your users a dialog box but still allow you to design the
form to your specs.

Curtis

"Dusty Hackney" <Dusty Ha*****@discussions.microsoft.com> wrote in message
news:2B**********************************@microsof t.com...

Hello,

I am programming in Visual Basic .NET. I have seen examples of creating a
login form to use for users to type in their username and password, but I
want to accomplish the same thing with a pop-up dialog box instead. How
can
I make my program bring up a pop-up login dialog box for a user to type in
username and password?

Thanks,
Dusty



"Dusty Hackney" <Dusty Ha*****@discussions.microsoft.com> schrieb:

I am programming in Visual Basic .NET. I have seen examples of creating a
login form to use for users to type in their username and password, but I
want to accomplish the same thing with a pop-up dialog box instead. How
can
I make my program bring up a pop-up login dialog box for a user to type in
username and password?



If you are using VS 2005:

Select "Project" -> "Add new item..." -> "Login Form" -> "Add". Then use
the following code to display the login dialog:

\\\
Using f As New LoginForm()
If f.ShowDialog = DialogResult.OK Then
Password = f.PasswordTextBox.Text
Username = f.UsernameTextBox.Text
End If
End Using
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>


Herfried,


\\\
Using f As New LoginForm()
If f.ShowDialog = DialogResult.OK Then
Password = f.PasswordTextBox.Text
Username = f.UsernameTextBox.Text
End If
End Using
///


It sound strange, however normally it will not needed ot return the
password, that can be checked in the dialog itself. An Ok is more than
enough and than in the code.

If f.showdialog <> dialogresult.OK me.close

A typical question for you. How do I get rit of that error warning (shared
member) with this in VB2005?

Cor



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

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