如何从VB应用程序注销 [英] How to log out from a vb application

查看:403
本文介绍了如何从VB应用程序注销的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于MySQL db的登录表单,当我单击从MAin表单中注销时,我使登录表单显示出来,但是它并没有阻止某人使用其他表单,我该怎么做?表单会在其他表单之上脱颖而出,或者使系统无法使用,除非一个用户登录.

在此先感谢..

I have a login form for MySQL db, when i click log out from the MAin form, I make the log in form to show, but it doesn''t stop someone from using the other forms, How do i make this form stand out on top of other form or make the system not usable unless one logs in.

Thanks in advance..

推荐答案

由于您在谈论表单,因此我认为这是WinForms吗?

如果是这样,那就使用
Since you are talking about forms, I assume this is WinForms?

If so then just use
if (myLoginForm.ShowDialog() == DialogResult.OK)
   {
   ...
   }

ShowDialog方法暂停处理,直到用户响应或关闭了表单.


您在VB中创建的表单是WinForms吗?嗯
正在使用此代码:
昏暗的frm作为新的frmLogin
frm.MdiParent = Me
frm.ShowDialog()
当我添加frm.ShowDialog(DialogResult.OK)时,它说它不能转换成Win32形式."



抱歉-C#而不是VB:

The ShowDialog method halts processing until the user has responded or closed the form.


"the forms you create in VB are WinForms? Well
am using this code:
Dim frm As New frmLogin
frm.MdiParent = Me
frm.ShowDialog()
When i add frm.ShowDialog(DialogResult.OK) it says it cant be converted to win32 forms"



Sorry - C# rather than VB:

Dim frm As New frmLogin
If frm.ShowDialog() = DialogResult.OK Then
   ...
End If


这篇关于如何从VB应用程序注销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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