0
私は "phonetxt"という名前のテキストボックスを持つ "customer.cs"という名前のウィンドウフォームを持っています。私はモデルmyclass.csという名前のクラスを持っています。 "customer.cs"に というコード行があります。stringを "name"データ型を制御する方法に変換するには?
private void customerphone_Leave(object sender, EventArgs e)
{
if (customerphone.Text != "Enter Phone Number" && customerphone.Text == "")
{
this.customerphone.Text = "Enter Phone Number";
this.customerphone.ForeColor = Color.DarkGray;
errorcustomerphone.Icon = Properties.Resources.err;
errorcustomerphone.SetError(customerphone, "Enter Phone Number");
}
else
{
errorcustomerphone.Icon = Properties.Resources.ok;
errorcustomerphone.SetError(customerphone, "Enter Phone Number");
}
}
私は、誰かが私を助けてください
customer.csに
methodfortext("customerphone","errorcustomerphone","Enter PhoneNumber");
//that will send these parameters to myclass.cs
methodfortext(string controlname, string errorname , string name)
{
//i want
controlname.Text = name;
errorname.Icon = Properties.Resources.err;
}
を呼び出す方法をしたい、私はuの人は私が望むものを得たのC#.hopeに新たなんです。