下面好多热心大佬一点我就通了 所以已解决 原来是int Sum1 = Numb1 + Convert.ToInt
32(Tbx4Dol2);
的Tbxdol2没加到text
谢谢
http://sendvid.com/9i15m3gq
———-
大佬们好
小弟商学毕业 想转职自己买课本来学C#
已经自己练习一周 目前遇到一些程式问题无法解决 麻烦请大佬们帮我看一下
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 电影院售票系统
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Lb1Price.Text = "单价";
Lb2Num.Text = "张数";
Lb3Dol.Text = "金额";
Lb4Ful.Text = "全票";
Lb5Che.Text = "优待票";
Lb6Sum.Text = "合计";
Lb7250.Text = "250";
Lb8200.Text = "200";
Tbx1Num1.Text = "";
Tbx2Num2.Text = "";
Tbx3Dol1.Text = "";
Tbx4Dol2.Text = "";
Tbx5sum1.Text = "";
Tbx3Dol1.ReadOnly = true;
Tbx4Dol2.ReadOnly = true;
Tbx5sum1.ReadOnly = true;
Tbx1Num1.MaxLength = 2;
Tbx2Num2.MaxLength = 2;
Tbx1Num1.TabIndex = 0;
Tbx3Dol1.Text = "0";
Tbx4Dol2.Text = "0";
}
private void Bul5Dol3_Click(object sender, EventArgs e)
{
}
private void Tbx1Num1_TextChanged(object sender, EventArgs e)
{
try
{
int Numb1 = Convert.ToInt32(Tbx1Num1.Text) *
Convert.ToInt32(Lb7250.Text);
Tbx3Dol1.Text = Numb1.ToString();
int Sum1 = Numb1 + Convert.ToInt32(Tbx4Dol2);
Tbx5sum1.Text = Sum1.ToString();
}
catch
{
Tbx3Dol1.Text = "0";
}
}
private void Tbx3Dol1_TextChanged(object sender, EventArgs e)
{
}
private void Tbx2Num2_TextChanged(object sender, EventArgs e)
{
try
{
int Numb2 = Convert.ToInt32(Tbx2Num2.Text) *
Convert.ToInt32(Lb8200.Text);
Tbx4Dol2.Text = Numb2.ToString();
int Total = Numb2 + Convert.ToInt32(Tbx3Dol1.Text);
Tbx5sum1.Text = Total.ToString();
}
catch
{
Tbx2Num2.Text = "0";
}
}
private void Tbx5sum1_TextChanged(object sender, EventArgs e)
{
}
private void Tbx1Num1_Enter(object sender, EventArgs e)
{
}
private void Tbx2Num2_Enter(object sender, EventArgs e)
{
}
}
}