Re: [問題] Console.WriteLine 改到 Textbox上

看板C_Sharp (C#)作者 (真。假凱文)時間15年前 (2011/05/03 10:39), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《jakevin (真。假凱文)》之銘言: : 我是自學 C# 所以針對書上用 console的方法 轉到 windows Form不是很懂 : 課本程式碼是這樣的 : class Human{ : public int Height =160; : private void PrintHeight() : { Console.WrireLine("你的身高是{0}",Height);} : } : class Main{ : Human Lee = new Human() : Lee.PrintHeight(); : } : 我想把 Lee.PrintHeight() 方法上的結果 : 放到TextBox上,卻不知道怎麼使用才好 : 所以上來請教各位板友了 <(_ _)> 感謝各位的解答! 我改用的方式是 public string Printage() { return "你的身高" + age; } 輸出 textBox.Text = Lee.Printage(); 必須完全放棄掉,物件內使用的 Console.WriteLine -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.124.75.85
文章代碼(AID): #1DlshCWY (C_Sharp)
討論串 (同標題文章)
文章代碼(AID): #1DlshCWY (C_Sharp)