使用的控件有:Button,Label,TextBox
button:表示一个按钮,用户点击按钮触发事件 click事件最常用
label:标签,用于显示文本 Name属性:变量名称
textBox:输入框
Form1代码:
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 _1.Winform控件学习
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
//控件除了拖拽,也可以自定义(窍门:查看属性列表)
TextBox userNameTextBox = new TextBox
{
Location = new Point(350, 40),