重叠两种形式 [英] overlapping two forms

查看:132
本文介绍了重叠两种形式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有两种形式,即登录表单和主表单.我想从重叠中查看...当我运行解决方案时,我想查看登录表单和背后的主表单..当我输入ID和密码时,我希望登录消失,只有主表单保留..为我提供代码....

suppose i have two forms i.e. login form and main form. i want to see the from overlapping... when i run the solution i want to see login form and main form behind it..and when i type id and password i want login for to disappear and only main form remains.. can anybody provide me code for that....

推荐答案

使用ShowDialog方法从主表单中调用登录表单.它将一直保留在主窗体的前面,直到用户关闭该窗体为止.此时,将在ShowDialog调用后立即从指令中继续执行主窗体.
Call the login form from you main form using the ShowDialog method. It will remain in front of the main form until the user closes the form, at which point execution will continue in the main form from the instruction immediately after the ShowDialog call.


Windows形式:

在主窗体的form_load事件中:
if you are using windows form :

inside your main form''s form_load event :
loginform objLogin = new loginform();
objLogi.show (); 



如果是asp.net

在主表单页面加载时执行此脚本



in case of asp.net

execute this script on page load of main form

window.open("loginform.aspx"



有关更多详细信息的编码,请与您的代码分享更多详细信息.

如果您发现这很有用,请不要忘记单击接受"作为答案:)



for more detail coding share more details abtt your code.

dont forget to click on accept as answer if you have found this useful :)


感谢您的建议,但我没能做到..所以请您为我提供代码. ..plz
thanks for your suggestion but i could not make it.. so can you please.. provide me with code...plz


这篇关于重叠两种形式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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