(完整)实验报告(word文档良心出品) .pdfVIP

  • 19
  • 0
  • 约1.24万字
  • 约 6页
  • 2024-10-19 发布于河南
  • 举报

(完整)实验报告(word文档良心出品)--第1页

Windows应用程序开发

一、实验目的

1.掌握窗口控件的使用方法;

2.掌握Windows的编程基础。

二、实验要求

根据要求,编写C#程序,并将程序代码和运行结果写入实验报告。

三、实验内容

1•编写一个计算器,练习在窗体上添加控件、调整控件的布局,设置或修改控件属性,编写事件

处理程序的方法。

(1)新建windows应用程序。在窗体Form上拖放一个TextBox控件、十六个Button控件,整个

窗体布局如下图所示

在计算器中,增加四个功能键:x,sqrt,log,ln四个键,分别计算求平方,开方,

2

log,ln值,将增加的代码写入实验报告。

2.自己编写一个Windows应用程序,使用4~5个公共控件。将程序功能、界面布局和运行结果

的截图与事件代码写在实验报告中。

第一题代码:

usingSystem;

usingSystem.Collections.Generic;

usingSystem.ComponentModel;

usingSystem.Data;

usingSystem.Drawing;

usingSystem.Linq;

usingSystem.Text;

usingSystem.Windows.Forms;

namespacecalculator{

publicpartialclassForm1:Form

{

doublea=0;

(完整)实验报告(word文档良心出品)--第1页

(完整)实验报告(word文档良心出品)--第2页

doubleb=0;

boolc=false;

stringd;

publicForm1()

{

InitializeComponent();

}

publicvoidForm1_Load(objectsender,EventArgse)

{

}

privatevoidbutton9_Click(objectsender,EventArgse)

{

if(c==true)

{textBox1.Text=;c=false;

}

textBox1.Text+=1;

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档