易截截图软件、单文件、免安装、纯绿色、仅160KB

c# winform窗体问题

我在form1中的某个方法让form2窗体出现
那么这个时候怎么关闭form1而不关闭form2呢?
Form2 f=new Form2();
f.Show();
this.Close();

引用
Form2 f=new Form2();
f.Show();
this.Close();

这样的话整个程序会关的!

看到了别人给的建议很受用:

方法1:另起一个线程来启动form2;
方法2:采用简单的办法仅仅将form1隐藏;
原因是:form1采用的是 application.ran(new form1);启动的一个线程那么如果form1中声明了一个form2的话那么form2也是form1的一部分。form1关闭的话form2也会关闭的!

Form2 f2 = new Form2();
this.Visible = false;
f2.ShowDialog();
this.Visible= true;
试试

应该另起一个线程调用form2

引用
Form2 f2 = new Form2();
this.Visible = false;
f2.ShowDialog();
this.Visible= true;
试试

这个是楼主的第2个方法。
关闭 form1而不关闭form2,需要把他们隔离起来

Form2 f2 = new Form2(); 
this.Visible = false; 
f2.ShowDialog(); 
就将FORM1隐藏.

ding...

ding a aaaaaaaaaaaa

Form2 f=new Form2(); 
this.Hide();
f.Show(); 
this.Close();


这样就好了

jf

static class Program
 {
/// <summary>
/// 应用程序的主入口点。
  /// </summary>
  [STAThread] static void Main()
  {
  App


相关问答:

c# 有没有用于C/S的 html文本编辑器

c# 有没有用于C/S的 html文本编辑器

就像web界面的文本内容编辑器


up

C/S还要编译器干嘛啊
又不用控制样式
貌似没有吧  如果有了通知下我  我也要liujintaohfbb@163.com我的邮箱 ......

急求ASP。NETC#购物车代码

最近在做个网上商城,购物车模块,没有做过,麻烦各位帮忙说下大致说下思路,能发一份源码更好。小弟先谢过各位了;
QQ:413763818;
eamil:swebook@126.com
网上一大堆!

www.51aspx.com

去下 ......

c#怎么读取mysql中 mediumtext类型的数据

如题:
C# code:
MySQLConnection con = new MySQLConnection( new MySQLConnectionString("localhost","beephpcms","root","root").AsString);
try
......

求一段delphi代码转C#代码,急用,可人民币支付,谢谢

急用。联系QQ:8775262,谢谢。
需要进行DllImport的地方直接写DLLImport.方法名。
如:DLLImport.GlobalAddAtom(……);
文件:UShare.pas
Delphi(Pascal) code:

unit UShare;
interface
uses Windows, Me ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号