我需要一个简单的程序帮助 [英] I need help on a simple progarm
问题描述
我是编程的新手,我需要一些问题的帮助。
创建一个具有TextBox的Windows应用程序来输入一个可以写的字母是E或F或G或I.在文本框附近包括适当的标签。 E代表英语,F代表法语,G代表德语,我代表意大利语。有一个提交按钮,点击后会显示一条消息,显示用户选择的语言。
有人可以帮我写出代码并帮助我理解它?谢谢。
Hi I''m new to programming and I need help with a certain question.
Creating a windows application that has a TextBox to input a letter which can be E or F or G or I. Including appropriate label near the text box. E represents English, F represents French, G represents German and I represents Italian. Have a submit button which when clicked will display using a message showing the language that the user has chosen.
Can someone help me write out the code and help me understand it? Thanks.
推荐答案
您只需在按钮点击事件中添加以下切换代码处理程序:
You only add the follow "switch" code in the button click event Handler:
string language = "unkown language";
switch (Textbox1.Text.ToUpper())
{
case "E":
language = "English";
break;
//...
}
MessageBox.Show(language);
以上所有,祝你好运。
All in the above, good luck to u.
这篇关于我需要一个简单的程序帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!