首先设计界面:
1.选择TextBox(允许用户输入文本,并提供多行编辑和密码字符掩码功);
2.选择label(为控件提供运行时信息或说明性文字);
3.选择Button(当用户单击它时引发事件);
4.在软件右下方有个属性的编辑框,可以修改按钮的属性。

界面设计1:


编写代码:
双击button按钮(即查询按钮);
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 Forms2
{
public partial class Fo

这篇博客介绍了如何使用C#创建一个简单的Windows应用程序,用户输入日期后点击按钮,程序会显示该日期是星期几。通过处理TextBox、Label和Button控件,实现了日期到星期的转换功能,提供了两种不同的代码实现方式。
最低0.47元/天 解锁文章
432





