作者jakevin (真。假凯文)
看板C_Sharp
标题Re: [问题] Console.WriteLine 改到 Textbox上
时间Tue May 3 10:39:05 2011
※ 引述《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