形式问题 [英] form problems

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

问题描述

Hii ..
我的表单代码遇到一些问题.
我在Visual Studio 2005中创建了两种形式.
第一种形式Form1,第二种形式1.
我在第一个窗体(Form1)中创建了一个按钮,然后添加了下面的代码以打开第二个窗体并关闭第一个窗体,这样它的作用就像一个浏览器,而不是打开太多的窗体和一个时间.
问题是,每当我运行该程序并单击该按钮时,两个窗体都会关闭.我希望第一个关闭,第二个打开...一些helpppppppp.
第一种形式的代码在这里:

 公共  Form1
    私有  Button1_Click( ByVal 发​​件人 As 系统.对象 ByVal  e  As  System.EventArgs)句柄 Button1.Click
         .Close()
        Form2.Show()
    结束 
结束  

解决方案

使用Hide方法而不是Close.


您没有发布足够的信息来帮助任何人.编辑您的问题并发布更多代码-也许有人可以指导您.


确定..我更改了问题的样式


Hii..
I face some problems with my form codes.
I created two forms in visual studio 2005.
The First form, Form1, and the second form1.
I created a button in the first form(Form1) and then added the code below to open the 2nd form and close the 1st one, so that it acts like a broser, instead of opening so many forms and a time.
The problem is that whenever I run the program and click on the button, both of the forms close. I want the 1st one to close and the second one to open... some one helpppppppp.
The code for the 1st form is here:

Public Class Form1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Close()
        Form2.Show()
    End Sub
End Class

解决方案

Use Hide method instead of Close.


You have not posted sufficient information for anyone to be able to help you. Edit your question and post some more code - someone might be able to guide you then.


Ok.. I have changed the style of the Question


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

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