|
>Mr.Tさん
なにぶん初心者なもので、表現に至らない点ばかりございまして、大変申し訳ないです。。。
■No2611 (επιστημη さん) に返信
ソースコードを貼り付けますね。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Label;
using System.Windows.Forms;
namespace Lesson02
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
// Button button1;
// TextBox textBox1; [input] single-line
// TextBox textBox2; [output] multi-line
private void button1_Click(object sender, EventArgs e)
{
Twice t = textBox1.Text.Length > 0 ? new Twice(textBox1.Text) : new Twice();
label1.Text = t.Make();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
class Twice
{
private string text = "Hello World!";
public Twice() { }
public Twice(string t)
{
text = t;
}
public static string[] Make(string source)
{
return new string[] { source, source };
}
public string[] Make()
{
return Make(text);
}
}
}
私の訂正箇所自体が大幅に間違っている気がします・・・
|