[問題] 如何在class中去啟動已經寫好的windows form

看板C_Sharp (C#)作者 (奇怪 還沒收到??)時間14年前 (2011/06/15 21:24), 編輯推噓0(008)
留言8則, 2人參與, 最新討論串1/1
各位好... 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

06/15 21:36, , 1F
Application.Run(new Form1()) or new Form1().Show()
06/15 21:36, 1F

06/15 21:45, , 2F
請問VS 說我只有class檔案要加入excutable file 才行...
06/15 21:45, 2F

06/15 21:45, , 3F
可是我看書上也沒有加... >"<
06/15 21:45, 3F

06/15 21:46, , 4F
它不讓執行....
06/15 21:46, 4F

06/15 21:49, , 5F
我有把它弄成set as start up...
06/15 21:49, 5F

06/15 22:14, , 6F
Go to Properties 把output type設成console application
06/15 22:14, 6F

06/15 22:14, , 7F
instead of Class library
06/15 22:14, 7F

06/15 22:15, , 8F
tf 謝
06/15 22:15, 8F
文章代碼(AID): #1D-BAMa_ (C_Sharp)
文章代碼(AID): #1D-BAMa_ (C_Sharp)