作者m13m13m (奇怪 还没收到??)
看板C_Sharp
标题[问题] 如何在class中去启动已经写好的windows form
时间Wed Jun 15 21:24:36 2011
各位好...
CODE:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Trig_a_form
{
class Program
{
static void Main(string[] args)
{
Application.run(Form1);
}
}
}
我想再class Program的main function 启动时把我已经写好的windows form Form1
去activate起来...
可是试了一些方法都行不太通 请问问题在哪呢...
还是说 windows form Form1 它本身有method 可以自动启动?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.115.130.102
1F:→ tfshnike:Application.Run(new Form1()) or new Form1().Show() 06/15 21:36
2F:→ m13m13m:请问VS 说我只有class档案要加入excutable file 才行... 06/15 21:45
3F:→ m13m13m:可是我看书上也没有加... >"< 06/15 21:45
4F:→ m13m13m:它不让执行.... 06/15 21:46
5F:→ m13m13m:我有把它弄成set as start up... 06/15 21:49
6F:→ m13m13m:Go to Properties 把output type设成console application 06/15 22:14
7F:→ m13m13m:instead of Class library 06/15 22:14
8F:→ m13m13m:tf 谢 06/15 22:15