①在视图的工具箱中给form1窗口添加如下:
②combobox1的属性ltems赋值
并页面加载时设置combobox1无法编辑,只读;
③button1的text属性赋值"=";
④textbox3设置readonly属性,赋值true,让textbox3为只读;
⑤代码:
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 _02计算器
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//分别获取textbox1,textbox2;