使用可变内容 [英] using variable content
本文介绍了使用可变内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请解决此错误
please solve me this error
MessageBox.Show(clsVariable.+"account."+textBox1.Text);
我想要
当textBox1.tex = 1并按button1时显示account1 content1(111)
当textBox1.tex = 2并按button1时显示account1 content1(222)
当textBox1.tex = 3并按button1时显示account1 content1(333)
i want
when textBox1.tex = 1 and press button1 show account1 content1 (111)
when textBox1.tex = 2 and press button1 show account1 content1 (222)
when textBox1.tex = 3 and press button1 show account1 content1 (333)
namespace test
{
public partial class clsVariable
{
private static string a7;
public static string account1 { get { return a7; } set { a7 = value; } }
private static string a8;
public static string account2 { get { return a8; } set { a8 = value; } }
private static string a9;
public static string account3 { get { return a9; } set { a9 = value; } }
}
public partial class Form1 : Form
{ public Form1() { InitializeComponent(); }
private void Form1_Load(object sender, EventArgs e)
{
clsVariable.account1 = "111";
clsVariable.account2 = "222";
clsVariable.account3 = "333";
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(clsVariable.+"account."+textBox1.Text);
}
}
}
推荐答案
^ ]
这篇关于使用可变内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文