关闭为表格 [英] Closing as Form

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

问题描述

您好,

我的问题是:

我有一个登录表单,所以一旦用户输入vaild用户名&密码另一个

表单打开。


如何关闭登录表单?

任何人都可以帮助我!

解决方案

您好,

隐藏登录表单(成功登录后)并使用
$ b $显示主表单b ShowDialog()方法(假设登录表单是启动表单)。

或者,单独显示登录和主窗体(来自Sub Main())。也就是说,

显示使用ShowDialog的登录表单并基于对话框结果(例如:

DialogResult.OK成功登录),关闭登录表单并显示

使用Application.Run()的主窗体。


HTH。


" Partha Protim Roy" < PA **** @ capoint.com>在消息中写道

news:uH ************** @ TK2MSFTNGP10.phx.gbl ...

您好,

我的问题是:

我有一个登录表单,所以一旦用户输入vaild用户名&密码另一个

表单打开。


如何关闭登录表单?

任何人都可以帮助我!


Partha,


人们总是很难看到人们如何开始计划,所以在

除了Shiva之外,当我使用登录表单时,我在主表单的

load事件中启动登录表单。 (顺便提一下,你是否已经看过基于滚动的集成

安全性了,而不需要登录表单。)


然而直接你的问题。


dim f as new loginform

f.showdialog

密码= f.password

f.dispose。


我希望这有帮助吗?


Cor


你好湿婆,


谢谢你的回答


但是我的代码如下所示,这是用button_Click程序写的

block


Dim MainFrm As new frmMain


MainFrm.Show()


昏暗的LoginFrm作为新的frmLogin


LoginFrm.Hide()

frmLogin是StartUp对象,成功登录后打开frmMain。

如果我隐藏frmLogin但用户仍然可以看到它。


如果我隐藏表单,表单仍然驻留在内存中。我是否正确?

如果是这样我的申请会变慢。


问候

Partha



" Shiva" < SH ****** @ online.excite.com>在消息中写道

news:et ************** @ TK2MSFTNGP15.phx.gbl ...

隐藏登录表单(成功登录后)并使用ShowDialog()方法显示主窗体(假设登录窗体是启动窗体)。
或者,独立显示登录和主窗体(来自Sub)主要())。也就是说,
使用ShowDialog显示登录表单并基于对话框结果(例如:成功登录时使用DialogResult.OK),关闭登录表单并使用Application显示
主表单。跑()。

HTH。

Partha Protim Roy < PA **** @ capoint.com>在消息中写道
新闻:uH ************** @ TK2MSFTNGP10.phx.gbl ...
您好,

我的问题是:

我有一个登录表单,所以一旦用户输入vaild用户名&密码
另一个表格打开。

如何关闭登录表格?

任何人都可以帮助我!


Hello,
My problem is:
I got a Login form, so once the user enter vaild Username & Password another
form opens.

How do I close the login form?
Can any body help me!

解决方案

Hi,
Hide the login form (after successful logon) and show the main form using
ShowDialog() method (assuming logon form is the startup form).
Or, show the logon and main forms indepenantly (from Sub Main()). That is,
show the logon form using ShowDialog and based on the dialog result (eg:
DialogResult.OK for successful logon), close the logon form and show the
main form using Application.Run().

HTH.

"Partha Protim Roy" <pa****@capoint.com> wrote in message
news:uH**************@TK2MSFTNGP10.phx.gbl...
Hello,
My problem is:
I got a Login form, so once the user enter vaild Username & Password another
form opens.

How do I close the login form?
Can any body help me!


Partha,

It is always difficult to see how people start there programs, so in
addition to Shiva, when I use a login form I start the login form in the
load event of my main form. (Did you already look at rollbased integrated
security by the way, than it can be that the login form is not needed).

However directly your question.

dim f as new loginform
f.showdialog
password = f.password
f.dispose.

I hope this helps?

Cor


Hello Shiva,

Thank you for your answere

But my code is shown below, which is written in the button_Click procedure
block

Dim MainFrm As New frmMain

MainFrm.Show()

Dim LoginFrm As New frmLogin

LoginFrm.Hide()
frmLogin is the StartUp object, on successfully login it opens frmMain.
If I hide frmLogin but still it is visible to the user.

If I hide the form, the form is still residing in the memory. Am I correct?
If so my application will be slower.

Regards
Partha


"Shiva" <sh******@online.excite.com> wrote in message
news:et**************@TK2MSFTNGP15.phx.gbl...

Hi,
Hide the login form (after successful logon) and show the main form using
ShowDialog() method (assuming logon form is the startup form).
Or, show the logon and main forms indepenantly (from Sub Main()). That is,
show the logon form using ShowDialog and based on the dialog result (eg:
DialogResult.OK for successful logon), close the logon form and show the
main form using Application.Run().

HTH.

"Partha Protim Roy" <pa****@capoint.com> wrote in message
news:uH**************@TK2MSFTNGP10.phx.gbl...
Hello,
My problem is:
I got a Login form, so once the user enter vaild Username & Password another form opens.

How do I close the login form?
Can any body help me!



这篇关于关闭为表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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