当前位置:网站首页>C#winform 窗体事件和委托结合用法
C#winform 窗体事件和委托结合用法
2022-07-27 07:26:00 【济南医疗小程序状元】
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 WinFormsApp1
{
public partial class Form1 : Form
{
private TextBox box; //文本框
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
//label1.Text = "我是按钮按下事件";
}
private void button2_Click(object sender, EventArgs e)
{
}
private void button1_MouseDown(object sender, MouseEventArgs e)
{
label1.Text = "我是按钮按下事件";
}
private void button2_MouseUp(object sender, MouseEventArgs e)
{
label2.Text = "我是按钮松开事件";
}
private void 单击事件(object sender, EventArgs e)
{
label1.Text = "";
label2.Text = "";
}
}
}
效果

边栏推荐
- 什么是真正的 HTAP ?(二)挑战篇
- Examples of Oracle triggers
- 连接MySQL时报错:Public Key Retrieval is not allowed 【解决方法】
- Use of tigervnc
- Use Amazon dynamodb and Amazon S3 combined with gzip compression to maximize the storage of player data
- Bash: create a function that returns a Boolean value
- 【已解决】单点登录成功SSO转发,转发URL中带参数导致报错There was an unexpected error (type=Internal Server Error, status=500)
- MySQL backup strategy
- 电子量产项目框架--基本思想
- Showdoc vulnerability learning - cnvd-2020-26585 (arbitrary file upload)
猜你喜欢

mysql备份策略

Gossip: Recently, many friends talk about going abroad

Am I delayed by the code... Unfortunately, I became a programmer

Expose Prometheus metrics in Perl programs

Installation and use of apifox

单片机多级菜单
![Error when connecting to MySQL: public key retrieval is not allowed [solution]](/img/b3/41523d44924ec203e40453bace6627.png)
Error when connecting to MySQL: public key retrieval is not allowed [solution]

Use Amazon dynamodb and Amazon S3 combined with gzip compression to maximize the storage of player data

ARP广播实践案例

LeetCode56. 合并区间
随机推荐
SQLite common function integration
Clickhouse notes 1 | introduction, features | installation and use based on centos7 system | common data types | mergetree table engine | SQL operation
防止Cookie修改id欺骗登录
shell awk相关练习
JS regular expression implementation adds a comma to every three digits
Multithreading [preliminary - Part 1]
安装tensorflow
Installation and use of apifox
Comprehensive analysis of ADC noise-02-adc noise measurement method and related parameters
C language implementation of guessing numbers Games project practice (based on srand function, rand function, switch statement, while loop, if condition criterion, etc.)
Cadence(十一)丝印调整和后续事项
Shell functions and arrays exercises
Actual combat of flutter - Request encapsulation (I)
js正则表达式实现每三位数字加一个逗号
Am I delayed by the code... Unfortunately, I became a programmer
flink原理(一) 状态的TTL管理、容错机制
Systematic explanation of unit testing: mockito
Cadence (XI) silk screen printing adjustment and subsequent matters
Summary of several common ways to join dimension tables in Flink
小程序消息推送配置 Token校验失败,请检查确认