protected void btnAdd_Click(object sender, EventArgs e)
{
int a = Convert.ToInt32(ltAvailable.Text);
int b = Convert.ToInt32(txtInput.Text);
ltTotal.Text = a + b;
如何在文字和文本框中添加值?感谢
答案 0 :(得分:5)
下面:
#include <iostream>
#include "person.h"
using namespace std;
int main()
{
Person one;
Person two("Smith");
Person three("immanuel", "Kant");
one.Show();
one.FormalShow();
two.Show();
two.FormalShow();
three.Show();
three.FormalShow();
return 0;
}
答案 1 :(得分:0)
protected void btnAdd_Click(object sender, EventArgs e)
{
int a = Convert.ToInt32(ltAvailable.Text);
int b = Convert.ToInt32(txtInput.Text);
ltTotal.Text = (a + b).ToString();
您只需要在计算结果上调用.ToString()
这也可行
ltTotal.Text = Convert.ToString(a + b)