3
我設計了一個windows窗體,其中我放置了3個按鈕和一個richtextBox。
現在我想獲取程序代碼在richtextbox上點擊不同的按鈕,即我在每個按鈕的click()事件中寫入的。獲取C#中按鈕單擊的程序代碼
例
private void button1_Click(object sender, ButtonEventArgs e)
{
some code lines goes here //
.... // All these lines to be displayed in richtextBox
.... //
}
你想讓你的程序打印出源代碼,對嗎?當你點擊一個按鈕? – 2011-03-10 01:27:40
@ 0A0D:是的,你是對的。 – 2011-03-10 01:29:05
這被稱爲奎因。看到這裏:http://stackoverflow.com/questions/753467/the-shortest-program-that-prints-its-own-source-code-in-c – 2011-03-10 01:30:31