using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private Label lbl = null;
private void Form1_Load(object sender, EventArgs e)
{
lbl = new Label();
lbl.Text = "入力してください。";
lbl.Cursor = Cursors.IBeam;
lbl.Click += lbl_Click;
lbl.Anchor = AnchorStyles.Right;
lbl.AutoSize = true;
lbl.BackColor = Color.Transparent;
lbl.ForeColor = Color.Gray;
textBox1.Enter += lbl_Click;
textBox1.Leave += textBox1_Leave;
textBox1.Controls.Add(lbl);
}
void textBox1_Leave(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(textBox1.Text))
{
lbl.Visible = true;
}
}
void lbl_Click(object sender, EventArgs e)
{
this.lbl.Visible = false;
this.textBox1.Focus();
}
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKdXNpbmcgU3lzdGVtLkNvbXBvbmVudE1vZGVsOwp1c2luZyBTeXN0ZW0uRGF0YTsKdXNpbmcgU3lzdGVtLkRyYXdpbmc7CnVzaW5nIFN5c3RlbS5MaW5xOwp1c2luZyBTeXN0ZW0uVGV4dDsKdXNpbmcgU3lzdGVtLlRocmVhZGluZy5UYXNrczsKdXNpbmcgU3lzdGVtLldpbmRvd3MuRm9ybXM7CgpuYW1lc3BhY2UgV2luZG93c0Zvcm1zQXBwbGljYXRpb24xCnsKICAgIHB1YmxpYyBwYXJ0aWFsIGNsYXNzIEZvcm0xIDogRm9ybQogICAgewogICAgICAgIHB1YmxpYyBGb3JtMSgpCiAgICAgICAgewogICAgICAgICAgICBJbml0aWFsaXplQ29tcG9uZW50KCk7CiAgICAgICAgfQoKICAgICAgICBwcml2YXRlIExhYmVsIGxibCA9IG51bGw7CiAgICAgICAgcHJpdmF0ZSB2b2lkIEZvcm0xX0xvYWQob2JqZWN0IHNlbmRlciwgRXZlbnRBcmdzIGUpCiAgICAgICAgewogICAgICAgICAgICBsYmwgPSBuZXcgTGFiZWwoKTsKICAgICAgICAgICAgbGJsLlRleHQgPSAi5YWl5Yqb44GX44Gm44GP44Gg44GV44GE44CCIjsKICAgICAgICAgICAgbGJsLkN1cnNvciA9IEN1cnNvcnMuSUJlYW07CiAgICAgICAgICAgIGxibC5DbGljayArPSBsYmxfQ2xpY2s7CiAgICAgICAgICAgIGxibC5BbmNob3IgPSBBbmNob3JTdHlsZXMuUmlnaHQ7CiAgICAgICAgICAgIGxibC5BdXRvU2l6ZSA9IHRydWU7CiAgICAgICAgICAgIGxibC5CYWNrQ29sb3IgPSBDb2xvci5UcmFuc3BhcmVudDsKICAgICAgICAgICAgbGJsLkZvcmVDb2xvciA9IENvbG9yLkdyYXk7CiAgICAgICAgICAgIHRleHRCb3gxLkVudGVyICs9IGxibF9DbGljazsKICAgICAgICAgICAgdGV4dEJveDEuTGVhdmUgKz0gdGV4dEJveDFfTGVhdmU7CiAgICAgICAgICAgIHRleHRCb3gxLkNvbnRyb2xzLkFkZChsYmwpOwogICAgICAgIH0KCiAgICAgICAgdm9pZCB0ZXh0Qm94MV9MZWF2ZShvYmplY3Qgc2VuZGVyLCBFdmVudEFyZ3MgZSkKICAgICAgICB7CiAgICAgICAgICAgIGlmIChzdHJpbmcuSXNOdWxsT3JFbXB0eSh0ZXh0Qm94MS5UZXh0KSkKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgbGJsLlZpc2libGUgPSB0cnVlOwogICAgICAgICAgICB9CiAgICAgICAgfQoKCiAgICAgICAgdm9pZCBsYmxfQ2xpY2sob2JqZWN0IHNlbmRlciwgRXZlbnRBcmdzIGUpCiAgICAgICAgewogICAgICAgICAgICB0aGlzLmxibC5WaXNpYmxlID0gZmFsc2U7CiAgICAgICAgICAgIHRoaXMudGV4dEJveDEuRm9jdXMoKTsKICAgICAgICB9CiAgICB9Cn0K