帮别人问的问题,我也不知道为何问这么怪的问题。她是把VS默认新建窗口工程的代码给改了using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1());
Form a = new Form();
a.Show(); 用这句,运行时窗口一闪就完了
//a.ShowDialog(); 用这句,就不会消失 }
}
}个人猜测,会不会Show()不阻塞线程?? 我查了MSDN没找到相关说明。如果有可能,请附上MSDN的解释,谢谢
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1());
Form a = new Form();
a.Show(); 用这句,运行时窗口一闪就完了
//a.ShowDialog(); 用这句,就不会消失 }
}
}个人猜测,会不会Show()不阻塞线程?? 我查了MSDN没找到相关说明。如果有可能,请附上MSDN的解释,谢谢
解决方案 »
- [求助]定时执行,跨线程操作异常了...悲剧ing
- top参数化问题
- picturebox 遍历文件夹下的图片问题?
- 控件属性设置。、。。。。
- 在.NET里有没有想Html里的Selected标签一样的控件?
- 今天买了本《程序员修炼之道》 哪个爽啊40rmb
- asp.net中web页问题--急!在线等!分不够可以再加
- dll在加载的时候做了些什么工作?
- Win32_ServerConnection 得到的ComputerName 怎么转成IP地址格式
- winform 资源文件和dll文件的问题
- 处理csv文件中双引号的问题
- vs里面我双击按钮,我明明已经有这个按钮的事件代码了,可是它不给我跳到那里,而是重新给我开个空事件代码_click1,为什么?
Form a = new Form();
a.Visible = true;
a.Show();
a.Visible = true;
a.Show();
Application.Run 直到指定窗体关闭才退出,所以new的临时变量可以一直不被回收。
using System;
using System.Windows.Forms;namespace WindowsFormsApplication1
{
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
Form b= new Form();
Application.Run(b);
}
}
}
{
public partial class Form1 : Form
{
public Form1()
{
Form b = new Form();
Application.Run(b);
InitializeComponent(); }
}
}