这是一个简单的应用程序,应该记录学生信息。在表格上有用于诸如姓名、课程等信息的文本框和三个按钮“SET”、“CLEAR”和“GET”。set 按钮应该接受用户输入并将其存储为字符串,CLEAR 按钮清除所有文本框,GET 按钮应该将数据带回文本框。
namespace Project1
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
public void SetBttn_Click(object sender, RoutedEventArgs e)
{
string firstname = FirstNameTxtBox.Text;
string lastname = LastNameTxtBox.Text;
string course = CourseTxtBox.Text;
string mno = MNoTxtBox.Text;
string yrmark = YrMarkTxtBox.Text;
}
private void ClrBttn_Click(object sender, RoutedEventArgs e)
{
FirstNameTxtBox.Text = String.Empty;
LastNameTxtBox.Text = String.Empty;
CourseTxtBox.Text = String.Empty;
MNoTxtBox.Text = String.Empty;
YrMarkTxtBox.Text = String.Empty;
}
private void GetBttn_Click(object sender, RoutedEventArgs e)
{
FirstNameTxtBox.Text = firstname;
LastNameTxtBox.Text = lastname;
CourseTxtBox.Text = course;
MNoTxtBox.Text = mno;
YrMarkTxtBox.Text = yrmark;
}
private void ShowBttn_Click(object sender, RoutedEventArgs e)
{
{
phd newWin = new phd();
newWin.Show();
}
}
}
}