您当前的位置: 百科371电脑/网络VB → 电脑/网络内容 退出登录 用户管理 用户注册
本类热门文章
相关文章
中原建材网
VB关闭窗体问题,在线等待.

减小字体 增大字体

问题:在VB中有两个窗体。form1 和form2 ,在form1中有一个bottom1 点击后打开窗体from2并关闭form1.form1中代码如下:Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim frm As New Form2 frm.Show() Me.Close() End SubEnd Class在执行的时候会遇到一个问题,两个窗口会同时关闭。请高手帮忙解决。打开form2的时候关闭form1 不知道要怎么处理了。另外不要用hide().  

把frm定义为Form1中的静态全局变量,在工程设置里将Application下的ShutdownMode设置为 When last form closes

如果你对在VB中有两个窗体。form1 和form2 ,在form1中有一个bottom1 点击后打开窗体from2并关闭form1.form1中代码如下:Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim frm As New Form2 frm.Show() Me.Close() End SubEnd Class在执行的时候会遇到一个问题,两个窗口会同时关闭。请高手帮忙解决。打开form2的时候关闭form1 不知道要怎么处理了。另外不要用hide().这个问题有好的意见或 建议,请留言
[] [返回上一页] [打 印]
电脑/网络评论 (评论内容只代表网友观点,与本站立场无关!)

用户名: 查看更多评论

分 值:100分 85分 70分 55分 40分 25分 10分 0分

内 容:

         (注“”为必填内容。) 验证码: 验证码,看不清楚?请点击刷新验证码

中原建材网 简单版 站长QQ:382546553