2个回答
展开全部
private string GetAllText()
{
string text = string.Empty;
foreach (Control control in this.Controls)
{
if (control is System.Windows.Forms.TextBox)
{
// control object 转成 textbox
TextBox controltxt = (TextBox)control;
//
if (controltxt.Text.Length == 0)
MessageBox.Show("存在空值Text");
else
text += controltxt.Text + ",";
}
}
return text.Length!=0?text.Remove(text.Length - 1):string.Empty;
}
{
string text = string.Empty;
foreach (Control control in this.Controls)
{
if (control is System.Windows.Forms.TextBox)
{
// control object 转成 textbox
TextBox controltxt = (TextBox)control;
//
if (controltxt.Text.Length == 0)
MessageBox.Show("存在空值Text");
else
text += controltxt.Text + ",";
}
}
return text.Length!=0?text.Remove(text.Length - 1):string.Empty;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询